Language selection for new projects

Alex Martelli aleax at aleax.it
Fri Oct 17 05:01:11 EDT 2003


Limey Drink wrote:

> Alex, I don't know how you find the time to write such detailed replies
> :-) but they're very welcome.

Glad to be of help.


> I have the book Learning Python, I think its an excellent book for
> learning the core language but I have noticed on the O'reilly website a
> 2nd Edition being released in December.
> 
> Has the core of the language changed very significantly from the version
> covered in the first edition of Learning Python ?

Yes, the current Python (2.3) is substantially larger, even at its "core",
than the 1.5.2 version described in the current (old) edition of "Learning
Python".  The effect of some additions has been to marginalize idioms and
techniques previously prominent.  In particular, list comprehensions have
further marginalized lambda, map, reduce, filter; the apply built-in is
basically obsolete thanks to the *args and **kwds forms of argument
passing in function calls; nested lexical scopes make the good old idea
of "foo=foo" ``default arguments'' used for name injection into inner
scopes somewhat quaint and of little practical interest; ...  Not to
mention the reorganization of OO into "new-style classes", a much clearer
and simpler systematization than the "classic classes" that also remain
in the language (and indeed are the default, for backwards compatibility).

To teach the language today, one does not want to dwell on the way the
language was five years ago, and on features that remain in the language
just because of backwards compatibility constraints.  The parts of the
language that you should normally use in writing new code are in fact no
larger than the ones you should have used in Python 1.5.2 -- but they
ARE different to some measurable extent, say (hard to gauge) with some
75% overlap and 25% difference.  One day, when we can break _some_
backwards compatibility -- presumably at the release of 3.0, maybe 3
years from now -- many of the "just backwards compatiiblity" ideas will
be deprecated or removed; Guido van Rossum is on record as saying that
3.0 will be about simplification and getting back to "one obvious way
to do it", removing "legacy", backwards-compatibility-only stuff.


> Would you mind if I email you in the future if I am really stuck witha
> problem ?  looool :-)

Actually, I would: I prefer to discuss things on the newsgroup, since
this way one gets the benefit of multiple voices.  No single "expert"
has ALL the answers (not even me, nach!), and the give-and-take of
debate here often proves more productive than just getting some single
oracular response would.  Further, discussion here can benefit others
beyond the single person who's posing a question, so there are larger
returns for the same amount of effort.


Alex





More information about the Python-list mailing list