Why learn Python ??
John J. Lee
jjl at pobox.com
Tue Jan 13 00:53:53 CET 2004
"Bicho Verde" <bichoverde at sapo.pt> writes:
> I have some basic skills in programming (C, Pascal, Macromedia
> Actionscript) but don't know exactly what to do in the world of programming.
If you just want to motivate yourself for some semi-arbitrary project,
my advice is to start using some open-source software. All software
sucks, so you'll eventually find something that pisses you off enough
to make you want to fix it or do it from scratch, properly :-)
> And also I don't know exactly why would I learn Python rather than C#,
> C++ or Perl.
They are all very different languages. Trawl through google groups --
comp.lang.python is a great place to look for comments on all three
(but I would say that). Try some of Alex Martelli's posts. I used to
default to the widely-held position that "language wars" are mostly
content-free "religious" arguments, but experience has taught me
otherwise. There are big, important, differences in programmer
efficiency, in computer-resource efficiency, and in community support.
And, to some extent, in the ways they make you think about problems.
The issues are subtle and complicated, and understanding them requires
writing programs in a set of languages diverse enough to come
somewhere vaguely close to spanning the big space of language-design
I'm feeling particularly self-indulgent, so here are a bunch that seem
notable current players to me:
Python: All-round pragmatic winner, and elegant to boot. One
disadvantage: you'll struggle to motivate yourself to learn any other
language once you've used it ;-)
Perl: CPAN is great; the language is merely an insane version of Python
(yes, Perl does predate Python).
C++: No compromises on execution speed; plays well with C (and with
Python: check out Boost Python); horrendously complicated; no garbage
collector (unless you add one yourself, but then you'd be better off
mixing C++ with a saner language). Notable for "templates".
C: Needs no introduction!
Java: Solid security model; piles of code; shockingly mediocre language,
to the extent that there would be precious few sane uses of the thing
were it not for Jython and all those libraries (but watch out for over-
C#: Java for MS .NET users (to first order, anyway). .NET has broader
goals than Java for language interoperation, so even though Jim Hugunin
and others have done some initial work on a .NET implementation of
Python, dynamic languages like Python will likely never be full .NET
citizens (thanks to the design of the .NET CLR). If that full
citizenship is important to you, C# has that advantage, but I'm
reliably informed it's fairly well-described as "a Java clone"
(implying programmer-inefficiency), so I'd be inclined to look for a
better language with a good .NET implementation. Lisp? Smalltalk?
(there was talk of an excellent .NET smalltalk implementation, but I'm
not sure whether that was vapourware or not...)
O'Caml: Excellent execution speed without C/C++'s unpleasant bugs.
Functional (in the technical sense), with elegant static type
inference, but multi-paradigm: you can write procedural code too.
Requires a different way of thinking to procedural languages for best
use. Nasty syntax. O'Reilly book in English and French.
Haskell: Another functional language (like O'Caml); good for forcing you
to think functionally; lazy evaluation. Lots of good books.
Fortran: Still rules for some numerical analysis work.
Lisp: Powerful, elegant and well-established, but it has been argued
(see recent threads here) that Lisp macros are not best described as a
language feature, but rather as a harmful, Babel-inducing, tool for
making new languages.
Scheme: Cleaned-up version of Lisp. Beautifully simple. Suffers from a
splintering of the user community thanks to a multitude of subtly
different implementations. Worth learning just to read Abelsson &
Sussman's (sp?) freely-downloadable book "Structure and Interpretation
of Computer Programs".
Eiffel: Design by contract. The book to read is Meyer's "Object-
Oriented Software Construction". Full of interesting stuff, if you can
stand his self-importance ;-).
Lua: Pint-sized Python.
Erlang: Concurrent programming.
Ruby: Python with a smaller user community (unless you're Japanese),
some minor wins and losses, and a very questionable design decision or
two thrown in (see numerous threads on this group).
Smalltalk: Never tried it, but sounds interesting, and similar to Python
in some ways.
Oz: Prolog for the 21st century (OK, I admit I haven't a clue what it's
like really, but I have to try it some day...).
Mathematica and Maple: Heaven, if you're into maths.
Alex Martelli has pointed out the brain-stretching value of learning
languages of a different nature (some of which aren't Turing
complete): including query languages (eg. SQL) and markup languages
Everybody here will tell you this, but I'm going to say it yet again:
don't be so foolish as to think you have to write *all* your code in a
language like C++ (or C, or Fortran, depending on the use) just
because you want the program as a whole to run fast.
And take the current myopic view of static typing (in the eyes of the
great unwashed programming public) with a bucket of salt.
> Basicaly I don't know where to start, if there is much to do or
> if it is has it seems and there is software to everything nowadays and so
> doesn't make sense to spend time in learning a programming language.
> I just have this idea that I would like to contribute to the curve of
> accelarated exponential progress (technological singularity), artificial
> intelligence and so on. From that point of view there is much to do... But
You should be able to get that lot done in a weekend, no? <wink>
Really, if you buy the notion of a technological singularity, you've
got me well-and-truly puzzled as to how you fit that into your brain
at the same time as believing that "there is software to everything
> can I stand for it and where to start?
Small?... and, of course, keep your eyes peeled for something you
think really matters.
More information about the Python-list