A really bad idea.

M marvelan at hotmail.com
Thu Nov 14 10:38:43 EST 2002


Dear Python Community,

I use Python in several projects. One of the main benefits of doing
so is that my programmers can quickly learn Python and get productive.
Python is a great language to read. Very seldom does one of my programmers
missunderstand code somebody else have written. This is one, if not the most,
important aspect of a great language. Most of the time are spent in reading
code while adding a new module (to see where it should fit) or fixing
bugs. And by definition, for a non-trivial application, this is code that
somebody else wrote.

The ability to produce readable code is one of the best things with Python.

Python more or less forces you to write nice code. This is a good thing. Not
an issue when you are a single programmer on a project. But when you have a 
bunch of programmers with different skills this is great.


But I see a disturbing trend.

Just a few examples...
The new enumerate or zip function. If you look at the code using this function 
it is not at all obvious what the code does. Let say a programmer that knows
10 other languages looks at this code. I don't think he would right away 
understand what this function does. This construct is not obvious. Generators 
are another thing that are just horrible. They just don't work in a way
that one would expect from previous experience.

I understand that one will like to add features to a language in order to
make it more powerfull. But I argue that this must be done in a way so that
programmers of *different skill levels* will understand the code. C++ is one
horrible example of a very powerfull language that very few people actually
understands fully. It takes years to fully understand C++, where does this
leave time to think about architecture and algorithms?

And no, you can't just say that these constructs should never be used. It
won't work! Every language feature will eventually be used by somebody.
Just look at the C++ world. Full of guidelines how to avoid doing things
that nobody will understand anyway. And full of code that breaks these 
guidelines. 

I hope this is not a start of adding powerfull and hard to understand
features to Python.

Cheers
/Marv



More information about the Python-list mailing list