POV-Ray : Newsgroups : povray.general : The Language of POV-Ray : Re: The Language of POV-Ray Server Time
10 Aug 2024 21:05:06 EDT (-0400)
  Re: The Language of POV-Ray  
From: Chris Huff
Date: 10 Mar 2000 16:52:45
Message: <chrishuff_99-A03AEE.16543310032000@news.povray.org>
In article <38C8DC47.1BEAFE1C@neuro.informatik.uni-ulm.de>, Axel Baune 
<aba### [at] neuroinformatikuni-ulmde> wrote:

> From the viewpoint of a computer scientist (I'm one) this is a not a
> syntactically correct defiend for-loop. The variable of a for-loop
> belongs to the for-command and should be never _changable_ by the user. 

Why? I see it as just another specialized structural component, which 
should be used when it is appropriate. Your restriction on modifying the 
loop variable seems arbitrary...
You say you are a computer scientist, but are you a computer programmer? 
I am still inexperienced with programming(I've only done a couple 
particle simulators and a few POV patches), but I can't think of any 
reason the loop variable shouldn't be used except for counting.

Maybe if you defined a for loop as a block of code that is executed a 
fixed number of times...but then, why have an initializer and an 
increment statement? Your for loop should only take one parameter(the 
number of times to loop) and should always increment by 1. You could use 
this to do everything an ordinary for loop with your restriction could 
do...
It is just that your definition seems to be going to an extreme(the 
other extreme being only using goto. :-) ).


> Sorry for flaming, but this are the programming styles, which make
> software packages difficult to maintain, debug, readable and
> understandable by other programmers.

How is it hard to understand?

-- 
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/


Post a reply to this message

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