POV-Ray : Newsgroups : povray.general : The Language of POV-Ray : Re: The Language of POV-Ray Server Time
10 Aug 2024 15:19:33 EDT (-0400)
  Re: The Language of POV-Ray  
From: Axel Baune
Date: 10 Mar 2000 06:27:13
Message: <38C8DC47.1BEAFE1C@neuro.informatik.uni-ulm.de>
Hello,

Johannes Hubert wrote:
> 
> "PoD" <pod### [at] merlinnetau> wrote in message
> news:38C7EEA3.D0EE7FF1@merlin.net.au...
> > Axel Baune wrote:
> 
> > >Problem
> > > two: What if you want to increment the variable in non deterministic
> > > steps, e.g. different steps width in each loop or you didn't want to
> > > increment in each loop. Than you will need the old while-construct,
> and
> > > why blowing up Pov-Script with higly specialised commands if you
> already
> > > have flexibler and more general commends for them? As a more skilled
> > > programmer you can always write macros for specialised problems.
> >
> > Then use a while loop and nothing is lost, except that you've made
> your
> > script hard to read.  There's probably an easier way to do it using
> > for()
> 
> For example:
> 
> for (I = 1; I <= something; ) {
>     // loop body here
>     I += non_deterministic_increment;
> }
> 
> Johannes

This a an example of dirty programming!

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. 

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

Yours Axel Baune


Post a reply to this message

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