Replace for Goto

Carl Banks imbosol at aerojockey.com
Fri May 30 12:07:46 EDT 2003


Michele Simionato wrote:
> dvm5_0 at hotmail.com (Dvm5) wrote in message news:<aa2e3602.0305291436.65bf3f38 at posting.google.com>...
>> "Robert Clark" <res03db2 at gte.net> wrote in message news:<mailman.1054189309.17665.python-list at python.org>...
>> > play the game once
>> > priming read
>> > while answer is yes
>> > play the game again
>> > trailing read
>> > wend
>> 
>> I thought of that, but that is what I was specifically trying to
>> avoid. I dunno, mybe cause I was usually programming for calulators
>> (Some highschool classes just get SO boring and POINTless ^_^ ) so I'm
>> usually trying for eficiency. I wanted to prevent using such an
>> inefficient method.
> 
> Why do you think the while loop is more inefficient than goto ?
> Are you referring to pocket calculators ?? Have you ever timed the
> difference ???


I'm just guessing, since he mentioned calculators, that when he talks
about efficiency, he means "programmer input efficiency."

Being a novice, and not yet conditioned to think about always
refactoring all common code into a function, he probably read the
above and thought it was suggested he duplicate the code for the game.
This is bad enough on a computer with cut-and-paste, but try doing
that in an unweildy calculator without cut-and-paste.


-- 
CARL BANKS




More information about the Python-list mailing list