|
![](/i/fill.gif) |
"Axel Baune" <aba### [at] neuro informatik uni-ulm de> wrote in message
news:38C8DC47.1BEAFE1C@neuro.informatik.uni-ulm.de...
>
> Johannes Hubert wrote:
> >
> >
> > For example:
> >
> > for (I = 1; I <= something; ) {
> > // loop body here
> > I += non_deterministic_increment;
> > }
>
> From the viewpoint of a computer scientist (I'm one) this is a not a
> syntactically correct defiend for-loop.
Since we seem to look at details now (not to say beginning to split
hairs), I have to point out, that you are wrong: The "for" loop is
syntactically absolutely correct (in the languages C, C++, Java at
least) - on the *syntax* level there is nothing wrong with it.
However:
> Sorry for flaming, but this are the programming styles, which make
> software packages difficult to maintain, debug, readable and
> understandable by other programmers.
With this I may agree. I have never (as far as I can remember) actually
used a loop like this. I would rather use a while-loop for stuff like
that.
The point was to shows that a C/C++/Java style for-loop *can* change its
looping index.
Johannes.
Post a reply to this message
|
![](/i/fill.gif) |