Re: What Matters About Python?
Posted: Aug 13, 2007 2:21 PM
> <p>I return to this forum after a lengthy absence because
> it offers access to a community of well-informed, not to
> say opinionated, software technologists. I have just
> accepted an invitation to write a monthly column for the
> forthcoming <em>Python Magazine</em>, and I don't want to
> write only for existing Python users.</p>
> <p>Other writers will doubtless handle the technical side
> of the language, though I expect I will have a hand in
> that area as well. But I am interested in providing a
> rounded source of information to a broad readership, and
> would like to address philosophical and social as well as
> technical issues.</p>
> <p>So, what information about Python is the average reader
> looking for? Are Python users smug or self-effacing? Is
> there enough documentation? What are the warts, and what
> have you found Python to be especially good or bad
I think if you are going to be talking about things other than the technical side, a big thing to think about is "why do I like this language?" or "why would somebody want to pick up yet another language and if they do, why python?"
Personally, I have several comments or observations with no particular theme. I do like the language and it is the one I hack in at home most of the time.
1. I really, really like the array slicing and list comprehensions. I miss them in other languages. These two things make working with collections of data pretty simple. One I threw together the other day for comparing files in two directories was the following. Assume the file names are loaded in two arrays and that the path names have been lopped off
[x.lower() for x in linesSource if x.lower() not in map(string.lower, linesTarget)]
2. self has already been pointed out. I see the reason for it, it makes things painfully obvious, but it is, at times, ugly and having to spend plenty of time in C++, C#, VB(pick a flavor) and a couple other languages, I, along with others, sometimes for get to type self since just about every other language does not require self's equivalent.
3. I have found the community generally helpful. Lots of smart people and many of them are willing to answer questions and not sound too much like pedantic windbags.
4. Lots of libraries and interfaces into almost everything. If you have something to write, there is probably a python interface available for it at this point.
5. I think the whinging about the GIL is overdone. Yes it is a problem in some instances. There are also many solutions to the problem. And if massive performance and parallelism on a single processor is your goal, python probably isn't what you are writing in anyway. http://www.parallelpython.com/ is one such solution that offers an erlang like method of handling the problem.
6. Variable scoping and the 'global' keyword have caused me some annoyances in the past. In general practice it doesn't seem to be a problem, but when it bites you, it really bites you.
7. Array slicing and python's list based approach to strings makes it real handy for crunching strings. It may not be perl-powerful because regex is not built into the language, but I find it very handy for a multitude of file handling problems with logs, source code, etc.
8. cross platform support is good and I think, generally speaking, python users are, as a group, the most platform agnostic bunch. As a group I see much less of the windows vs. linux vs. OSX idiocy that seems to be more pervasive in other language communities. As a group I think pythonistas are a rather pragmatic bunch.
9. It would be nice to hear more about some commercial successes of python. python.org has the success page and bittorrent gets a bit of press, but I would imagine there are other instances where the language is used that would make people go 'wow' that we just don't know about.