why no "do : until"?

Steve Williams sandj.williams at gte.net
Tue Jan 2 16:21:49 EST 2001


Grant Edwards wrote:

> [slash]

>
> The problem is that when you decide to change the endpoint from
> 25 to something else, you _may_ have to change the code in two
> places: the test and the initialization.  If you decide to
> raise the endpoint from 25 to 50, you only have to change one
> line.  If you want to lower it you might have to change the
> initialization also.
>
> Requiring edits to two possibly widely seperated places in the
> source code to change a single algorithm value is (in my
> experience) going to cause a bug some day.
>

[more slash]

Ah, but variables are magic things:

intFoo = 25
intBar = 75
While intFoo < intBar:
  intFoo . . .

Wiring constants in the code (and maintaining them in multiple places) is for
the laity.

Do !do it.







More information about the Python-list mailing list