Compare source code

Ethan Furman ethan at stoneleaf.us
Sun Nov 7 11:20:11 EST 2010


Seebs wrote:
> On 2010-11-05, Ethan Furman <ethan at stoneleaf.us> wrote:
>> The verifiable benefit for me is ease of use, ease of thought, ease of 
>> typing... I realize these are not benefits for everyone, but they are 
>> for some -- and I would venture a guess that the ease of thought benefit 
>> is one of the primary reasons Python is popular.  I am definitely one of 
>> those that think indentation based structure is one of Python's best 
>> features.
> 
> Could you explain more the "ease of thought" thing?  I haven't yet noticed
> it, but it might be something to look out for as I get more experienced.


Most if my programming experience is in FoxPro versions 2 and 6. 
Control structures start with if, for, do case, do while, with, 
procedure, and (I think) function.  Control structures end with endif, 
endfor, endcase, endwhile, endwith, endproc, and (I think) endfunc.

In Python, control structures start with if, for, while, try, def, and 
class, and each one ends with a dedent.

This really comes into play when developing -- want to change that if to 
a while?  Go ahead!  And no need to worry about tracking down the 
closing endif to change it to endwhile, plus it's less clutter on the 
screen.

I also really like the dynamic typing and not having to declare nor 
pre-initialize variable names, as well as the lack of a true global 
namespace.

All in all, I am able to think about the code and what I want to do, and 
not think about the compiler/interpreter and keeping it happy.

Hope this helps.

~Ethan~



More information about the Python-list mailing list