469,949 Members | 2,244 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,949 developers. It's quick & easy.

Re: Help with Iteration

Aaron Brady <cast...pigmail.comwrote:
>while 1:
calculate_stuff( )
if stuff < 0.00005:
break
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
detail!

While their cudgels are bouncing off
your skull, they will scream the above three
lines into your swiftly swelling ears!

I suggest you write;

while True:
stuff = calculate_stuff()
if stuff < 0.00005:
break

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!

:-)

- Hendrik

--
No good deed will go unpunished.

Oct 19 '08 #1
0 624

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

21 posts views Thread by Steven Bethard | last post: by
2 posts views Thread by LoserInYourFaceEngineer | last post: by
14 posts views Thread by Henk | last post: by
75 posts views Thread by Sathyaish | last post: by
5 posts views Thread by Jef Driesen | last post: by
3 posts views Thread by tokcy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.