No Do while/repeat until looping construct in python?

William Sonna wsonna at attglobal.net
Fri Mar 14 11:29:44 EST 2003


On Thu, 13 Mar 2003 09:27:07 -0600, sismex0 wrote:

> Troll? Flamebait? Or just uninformed?

None of the above.  Legitmate criticism of questionable design decisions
made.  Either respond to the issues raised or look foolish- your choice.


>> ...so file it right next to "self" as the second of the two most-hated
>> "features" of the language.  The problem is that as a relatively small
>> language, you can't escape them.
>>
>>
> "Hated"?  Yeesh...
> 
> 
> 
> 
> 
> 
> 
Yes. Hated.  Go to the Ruby web site - one of the quoted "features" of
Ruby is not having to type "self".

>> The workaround for (no) repeat is to brake after the test placed at the
>> end of the loop.
>> 
>> 
> repeat ... until (condition)
> 
> is exactly the same thing; only that the language places the
> responsability of choosing the condition's location and exit point on
> the programmer, not the other way around.
> 
> For bonus points, can you point out the advantage of Python's approach
> and the disadvantage of language X's?
> 
> 
> 
> 
> 
> 
> 
> 
> 
Item 1 - one-or-more is *not* the same as zero-or-more.  It is mathematically
incorrect to make that claim.

Item 2 -  There can be no "advantage" to Python's way since there is no
way.  There is only a workaround.  The question is whether the addition
results in a correspnding disadvantage that outweighs the advantage.

The argument is NOT whether its already there (it isn't), or whether it
would be nice to have (it would), but whether it is sufficiently
important to justify its existence.

The general concensus is that it is not.  A substantial number disagree.


>> The workaround for "self" is to assign a local variable and use it
>> instead.
>> 
>> 
> Really...
> 
> "self", in an instance method, *IS* a local variable.  You can call it
> whatever you want: "me", "self", "this", "_", "obj", "instance", "here",
> "etc", ...
> 
> And, having it explicit and not implicit keeps the instance's namespace
> apart from the local namespace.
> 
> 
> 
> 
> 
> 

You've just contradicted yourself, (which is OK; it illustrates the
problem). Why would a local variable need to be qualified to keep it
separate from the local namespace? That's the *conceptual* problem with
"self".

The *practical* problem is that because common sense says the instance
variables are local, and typing "self" is a pain, the user has a double
disincentive to include it, resulting in gratuitous bugs.

It MAY be consistent with Python's general tendency to favor least-type
(both as in class, and as in typewriter), it DOESN'T help get the job
done.

Now, as for your personal attacks ("troll", "flaimbait", etc.), I have taken the
time to post legitimate criticism substatiated with facts.

If you feel the need to respond with trash-talk, you are welcome to do so,
but you really should look in the mirror before you call me anything.


On the other hand, if you have a valid reason why "self" is advantageous
FROM THE USER's POINT OF VIEW I would like to hear it.

I already know that:

a. "its already been talked to death! see html://blahblahblah"
b. "real Python programmers KNOW why"
c. "use (c++|Java|Perl|$your_pick) instead"
d. Python RULEZZZ
e. Please don't question the language or post critiques - somebody might agree
   with you!!

So you can skip those (or cut and paste, if you prefer).

[snip]




More information about the Python-list mailing list