[Edu-sig] "do" as a keyword
Brian Blais
bblais at bryant.edu
Wed Dec 12 19:19:35 CET 2007
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
bblais at bryant.edu
http://web.bryant.edu/~bblais
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/edu-sig/attachments/20071212/2e84e968/attachment.htm
More information about the Edu-sig
mailing list