Help with Iteration
Hendrik van Rooyen
mail at microcorp.co.za
Sun Oct 19 22:46:32 CEST 2008
Aaron Brady <cast...pigmail.com> wrote:
> calculate_stuff( )
> if stuff < 0.00005:
The thought police will come and get you.
You are doing things by "side effect"!
You are using a global called "stuff"!
You are relying on an implementation
While their cudgels are bouncing off
your skull, they will scream the above three
lines into your swiftly swelling ears!
I suggest you write;
stuff = calculate_stuff()
if stuff < 0.00005:
quickly, to avoid the pain!
It may be too late though - even the
above sanitised version is still too
tightly coupled - how must
calculate_stuff know where to find
the inputs for its calculation?
You are gonna bleed!
No good deed will go unpunished.
More information about the Python-list