POV-Ray : Newsgroups : povray.general : FEATURE REQUEST: MS Notepad text editing keystroke definitions : Re: FEATURE REQUEST: MS Notepad text editing keystroke definitions Server Time
12 Aug 2024 11:20:21 EDT (-0400)
  Re: FEATURE REQUEST: MS Notepad text editing keystroke definitions  
From: Nieminen Mika
Date: 29 Mar 1999 13:17:31
Message: <36ffc3bb.0@news.povray.org>
Ken <tyl### [at] pacbellnet> wrote:
:  What is indenting ?

  It's making your code much more easy to understand by putting commands
in the same code block at the same column.

:  Is this a new feature in Pov ?

  No, it's an old feature in programming.

:  Will it make my scenes look any better when they render ?

  No, but your source codes will.

:  Will it take up less space on my hard drive when I use it ?

  No, it will take more.

:  How do they stick them little worms inside Mexican jumping beans -
:  are they indented into it ?

  I don't understand the question.

:  Will I be able to see more script on the editing page at one
:  time using this method ?

  No, but you will undestands better what you are seeing.

:  Will my files compress more when archived if I used indented
:  script ?

  As someone said, your compression percentage may increase.

:  Will the rendering engine handle the file any differently one
:  way or another if I do or if I do not ?

  No, and that's a good thing.

:  How do they electroplate plastic products when plastic does not
:  conduct electricity and does indenting have anything to do with
:  it ?

  I don't think so.

:  If indenting is such an effecient method of writting data why
:  haven't modern book and magazine publishers started selling books
:  with indented pages ?

  It's not an efficient way of writing data. It's a good way to write
programming language code.
  And certainly books and magazines use indenting in their own way: they
use paragraphs, empty lines, often white spaces at the beginning of
paragraphs, etc. They don't write all the text in one long line.

:  Will it make any difference in the greater scheme of things
:  30 years from now ?

  Sure. People (including yourself) will understand the code much better.

:  Will society condem me and will I be ostrisized for non indented
:  code ?

  Sometimes. When you are making code for a company and you leave, the
next coder will curse you for making ununderstandable code.

:  Can you look at an image and tell if indenting was used to produce
:  it ?

  No.
  Can you say if the source code of POV-Ray is indented by using the
program?

  Indenting helps you a lot in understanding the program. For example it's
a lot easier to see where does a #while loop end when the code is indented.
  Can you tell me without editing this code what does it do?

#macro Random(Seed,Mid,Var) #local r=rand(Seed); #local lo=Mid-Var/2; #local
hi=lo+Var; #if(lo<0) #local lo=0; #end #if(hi>MaxVal) #local hi=MaxVal; #end
lo+r*(hi-lo) #end #macro CreatePlasmaArray(XSize,YSize,MaxVal,Seed) #declare
PCoord=array[XSize][YSize] #local R=seed(Seed); #local Div=2; #declare PCoord
[0][0]=Random(R,MaxVal/2,MaxVal); #while(Div/2<=XSize | Div/2<=YSize) #local
j=0; #while(j<Div) #local X=div(XSize*j,Div); #local Y=div(YSize*j,Div);
#local i=1; #while(i<Div) #local X1=div(XSize*(i-1),Div); #local X2=div(XSize
*(i+1),Div); #if(X2>X1+1) #local Xm=div(XSize*i,Div); #local C1=PCoord[X1][Y];
#local C2=PCoord[mod(X2,XSize)][Y]; #declare PCoord[Xm][Y]=Random(R,(C1+C2)/2,
X2-X1); #end #local Y1=div(YSize*(i-1),Div); #local Y2=div(YSize*(i+1),Div);
#if(Y2>Y1+1) #local Ym=div(YSize*i,Div); #local C1=PCoord[X][Y1]; #local C2=
PCoord[X][mod(Y2,YSize)]; #declare PCoord[X][Ym]=Random(R,(C1+C2)/2,Y2-Y1);
#end #local i=i+2; #end #local j=j+2; #end #local j=1; #while(j<Div) #local
Y=div(YSize*j,Div); #local Y1=div(YSize*(j-1),Div); #local Y2=div(YSize*(j+1),
Div); #if(Y2>Y1+1) #local i=1; #while(i<Div) #local X=div(XSize*i,Div); #local
X1=div(XSize*(i-1),Div); #local X2=div(XSize*(i+1),Div); #if(X2>X1+1) #local
C1=PCoord[X1][Y]+PCoord[mod(X2,XSize)][Y]+PCoord[X][Y1]+PCoord[X][mod(Y2,YSize
)]; #declare PCoord[X][Y]=Random(R,C1/4,(X2-X1+Y2-Y1)/2); #end #local i=i+2;
#end #end #local j=j+2; #end #local Div=Div*2; #end #end #macro CreatePlasma
(XSize,YSize,Roughness,Seed) #if(XSize<=1 | YSize<=1) #error "XSize and YSize
must be greater than 1" #end #if(Roughness<0) #warning "Roughness should be
greater than 0\n" #end #local MaxVal=Roughness*(XSize+YSize)/2;
CreatePlasmaArray(XSize,YSize,MaxVal,Seed) #local IndY=0; #while(IndY<YSize)
#local IndX=0; #while(IndX<XSize) PlasmaObject(IndX/(XSize-1),IndY/(YSize-1),
PCoord[IndX][IndY]/MaxVal) #local IndX=IndX+1; #end #local IndY=IndY+1; #end
#end


-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.