On Dec 12, 2007, at Dec 12:11:26 AM, kirby urner wrote:
Also people have different styles, like you
don't need to use a bare True, but might
go like:
untouched = True
while untouched:
keepmoving()
or something similar.
True, and this is what I do, but I find myself more often than not,
in the robotics context, thinking of the loop in "until" mode, and
then reversing the logic to fit it into the "while".
I wouldn't make "intuitive" the guiding light in all cases, as it's
often just code for "conditioned reflex" or "what we're used to."
Usually beginners outgrow their initial discomfort, like when
learning to drive stick instead of automatic or whatever.
That is also true, if the intuition were limited to the beginner.
Unfortunately, I find myself thinking in this way, and I don't
consider myself to be a beginner, and I have a firm understanding of
while, for, and if structures. I think it is usually in the context
of robotics, or moving agents, that I find that I think in terms of
"until". I recognize that it is a special case, and not in the
pythonic tradition, and I am not endorsing adding it for that reason.
I'll try the while-true-if-break construct on for size, and see how
well it fits my brain after using it for a while.
bb
--
Brian Blais
[EMAIL PROTECTED]
http://web.bryant.edu/~bblais
_______________________________________________
Edu-sig mailing list
[email protected]
http://mail.python.org/mailman/listinfo/edu-sig