Why is Python a good first scripting language?

Fernando Pérez fperez528 at yahoo.com
Sat Oct 19 18:58:39 EDT 2002


Tim Teebken wrote:

> Hello, I'm a Windows developer looking for a versatile, open source
> scripting language that runs on Windows and other platforms.  I'm not
> terribly interested in religious debates about languages, and wouldn't mind
> learning several of the open source options eventually.  But now I need to
> choose one to start with.  Here are some things I'm looking for:
> 
> (1)  Clean, terse, easy-to-read syntax.  All subjective terms, and everyone
[snip]

>From personal experience, in this regard python is better than anything I've 
seen in ~12 years of programming with a reasonable set of languages.

> (2)  Not captive to one methodology.  To the man with a hammer, everything
[snip]

Python starts looking like a normal procedural language, has immediate and 
very clean OO access, has functional constructs (even though it's not quite 
lisp), and things like list comprehensions from Haskell. Overall I find it 
eclectic enough never to feel like a strait jacket.

> (3)  Now to qualify (2):  it should not be a language with so many ways of
> doing things that you can't identify a "best way," or at least a "good way."
> Perl has been noted for having nearly infinite options for tackling
> problems, which is a strength and a weakness.

Indeed. Having ditched Perl for python about a year ago, I'd say that in this 
particular point python shines over perl. While not being overly 
constrictive, there tends to be a 'reasonably obvious and best' way of doing 
most things. Basically the 'right solution feels natural', which is hardly 
the case in Perl (see the man page/cookbook entry for a switch statement in 
Perl if you want a good laugh on this topic).


> (4) "Fast enough" performance.  It doesn't have to be faster than competing
> scripting languages, but  shouldn't be radically slower.

Python is fine here in most cases.

> 
> (5) Extended and extensible.  There should be a reasonably large set of free
> and commercial modules and extensions available, and it should be possible
> to extend it yourself via a lower-level language.

SWIG, Boost.Python, scipy.weave, Pyrex, Psyco. Pick your choice (each targets 
a specific way of speeding things up). This is one of python's greatest 
strengths. Think of it this way: if it's good enough for large-scale, 
supercomputer-bound scientific codes (with a suitable mix of fortran/C 
libraries for the core), it's probably extensible enough for you.

> (6) Large user base, active developer community, and a large set of free and
> commerical documentation.  In other words, it has a healthy "growth index"
> and bright future relative to near competitors.

The c.l.py community is great.

> (7) Internal consistency and expressiveness.  As with (1), these are

Works great for me. Guido is a mathematician by training, and I think that 
shows in python. A certain cleanliness in the design is readily apparent. 
Mind you, the language _does_ have warts, but overall I find it very clean 
and pleasant to work with.

Ultimately it's a matter of personal preference, but I'd suggest you do give 
python a try. Your shopping list sounds almost like a python advocacy piece, 
so I'd be willing to bet you'll like it in the long run.

Cheers,

f.



More information about the Python-list mailing list