PEP scepticism

Steve Horne sh at ttsoftware.co.uk
Thu Jun 28 13:01:35 EDT 2001


On 28 Jun 2001 14:47:19 GMT, bernhard at intevation.de (Bernhard Reiter)
wrote:

>This a general warning against the second system syndrom in Python.

I think you may have a good point for the future, but I'm actually a
big fan of some of those recent additions to Python.

Although Python probably makes an excellent teaching language, I'd
imagine most Python programmers have used some other languages before.
Of the example changes you mentioned...

>	- augmented Assigments

Extremely familiar to anyone with a C, C++ or Java background, and
something that I was annoyed to have to live without when I first used
Python. I don't remember ever finding the idea of += or -= operators
anything but completely natural, even when I first saw them. I'd
contest the use of % for mod (the meaning is not immediately obvious)
but += and -= are completely natural.

The augmented assignments beyond += and -= are simply extending the
same principle as far as possible - something Python has always done,
and which is a large part of its simplicity.

>	- Lists comprehensions

Another large group of Python programmers have a background in
functional languages, and will immediately understand list
comprehensions. I can see how at first glance they might look strange,
but really they are just describing - rather than listing - the
required items. The second glance should be a revelation!

Functional languages provide a very useful and very simple approach to
many types of problem. The inclusion of functional features into
Python is one of its best attributes. Few other languages allow you to
switch paradigms to whatever suits your task. But without list
comprehensions, the functional features get pretty clunky.


I can understand the wish to only have one way to solve any problem,
but it really isn't that great an approach. If a task can be attempted
using two different approaches, then you have a choice - you don't
have to force the first approach to fit. I look forward to a day when
there are even more tools in the box. After all, have you ever met an
electrician who only owns a single screwdriver? - I think not. Doing a
good job means using the right tool for the job, not forcing a single
tool to do every job.


I first started using Python at version 1.4. The recent evolution of
Python has resulted in many of my commonly used scripts becoming much
more powerful and useful, yet smaller and much more readable - despite
the fact that I only get a chance to work on them at odd moments when
there is no rush.

If typical Python programs are simpler, more readable, yet at the same
time more useful and powerful than was possible in the past - all
without spending a lot of time in development - I don't think the time
has yet come when we need to worry about excess features.

-- 
Steve Horne
Home : steve at lurking.demon.co.uk
Work : sh at ttsoftware.co.uk



More information about the Python-list mailing list