Python indentation deters newbies?

Keith P. Boruff kboruff at optonline.net
Sat Aug 14 18:50:25 EDT 2004


beliavsky at aol.com wrote:
> One of the most commmon reasons programmers cite for not trying Python
> is that indentation determines the program flow -- they think its
> weird. I think programmers who actually try Python adapt quickly and
> do not find the indentation rules to be a problem.

Honestly, I'm still not too crazy about the indentation requirements of 
the language myself, coming from a background of using all free form 
languages.

This isn't too big a deal though since I use emacs and the Python mode 
basically does the indentation for me.

In addition, if anyone here has dealt with makefiles, I'm sure they're 
well aware of the requirement to indent (in this case 'tab') certain lines.

Things I like about the language that offset my displeasure of the 
indentation rules are:

1. The mechanics of the language are easy to pick up. No funky '$', '@' 
decorators to deal with. There are the * and ** decorators that you can 
use in function parameter definitions but that's not a big deal.

2. The language is well documented. I had to learn Python on the fly and 
the documentation was excellent in getting me up to speed.

3. Good basic/standard API. Not too big; not too small and again... well 
documented.

4. Nice, tight modularity.

If I have any big problem with python, it's in the semantics of the 
classes. It seems a bit... well... weird in some cases. Two of the 
things I don't like about it is that there's no access specifiers for 
the class components (public, private, protected) like C++ and Ruby, for 
example.

Also, I'm not too thrilled about the 'new class style' that I read about 
in books.. meaning that you should inherit your base class from 
'object'. To me, it seems a bit of a hack.

All in all though, a good language. I was able to construct a script 
generator for one of our test programs at work using Python to access a 
DB and put out flat file representations of the DB data in less than 3 
days without being a 'super Python pro'.

Keith Boruff








More information about the Python-list mailing list