Is python worth learning as a second language?

Delaney, Timothy (Tim) tdelaney at avaya.com
Mon Mar 9 20:05:00 EDT 2009


ZikO wrote:

> I am a C++ programmer and I am thinking of learning something else
> because I know second language might be very helpful somehow. I have
> heard a few positive things about Python but I have never writen any
> single line in python so I do not know this language at all.
>
> Do you think python would be good complementary language for C++? Do
> you think it's worth learning it or let's say try Java? and how
> difficult it would be for me if I know C++ pretty well I would say?

Python is an excellent first, second or 20th programming language. It's
a lot easier to interface Python with C++ than it is to interface Java
with C++ (but both are possible).

I tend to use multiple languages daily (at any time usually 4-5 in
regular use) and I've "forgotten" at least 20 languages (i.e. they're no
longer in regular use - but I could probably pick them up again
quickly). The more programming languages you learn, the easier it is to
learn new ones.

The first thing to do when learning a new language is to drop any habits
you learned with the language you're currently using. If you find
yourself asking "How do I implement <idiom> in Python?", stop and
instead ask "What problem am I trying to solve?". Quite often idioms
from other languages result in much more verbose and much slower code.

The same thing happens going the other way - so often in Java I get
frustrated because there's so much more boilerplate to implement what
are simple idioms in Python. Unfortunately in Java, usually there isn't
a simpler alternative available ...

Eventually you should learn both Java and Python, if only to be exposed
to different approaches to doing things.

Tim Delaney



More information about the Python-list mailing list