|
![](/i/fill.gif) |
In article <38C8DC47.1BEAFE1C@neuro.informatik.uni-ulm.de>, Axel Baune
<aba### [at] neuro informatik uni-ulm de> 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] yahoo com
Web page: http://chrishuff.dhs.org/
Post a reply to this message
|
![](/i/fill.gif) |