for / while else doesn't make sense

Christopher Reimer christopher_reimer at icloud.com
Fri May 20 21:23:57 EDT 2016


On 5/20/2016 3:43 PM, Steven D'Aprano wrote:

> But the idea that you should avoid a Python feature while programming in
> Python because Javascript doesn't have it, or Ruby, or C, is surely the
> height of muddleheaded thinking. You're not programming Javascript, Ruby or
> C, you're programming in Python. The whole point of picking one language
> over another is to get access to the tools and features that language
> offers. Otherwise you're just wasting your time.

For many years I have resisted specializing in a programming language, 
as I can easily write any program in pseudo code and figure out the 
syntax for a particular language. Now it does help that most languages 
have derived from C and share a common feature set (i.e., string, 
integer, float, if/else, while, for, etc.). From my perspective, tacking 
on an else block to the end of a for or while loop looks like a bug or a 
not very well thought out feature. If I was translating a Python program 
with for/else or while/else statements into a different language, those 
statements will have to be rewritten anyway.

Thank you,

Chris R.





More information about the Python-list mailing list