Should I learn Python or Java?

Martijn Faassen m.faassen at vet.uu.nl
Sat Jan 6 22:34:33 EST 2001


Charlotte Williams <charlottwilliams at mediaone.net> wrote:
[snip]
> I notice that there is a lot of demand for Java programmers.  The only
> experience I have with an OO language is Smalltalk.   My questions are:

My background: I'm not intimately familiar with VB, but I know Basics and
I know what it's about. I'm not intimately familiar with Java either,
but I know C++ and I figure I know what Java's about too. :)

> 1.  Which language would be best to learn, Java or Python.  From a VB
> standpoint, which has the least learning curve?

Python would definitely have the easier learning curve. Python's syntax
is simpler and it allows for a more interactive style of programming 
than Java. It doesn't really matter what language you're coming from,
in fact; even coming from C++ (which is much like Java in quite a few
ways, especially syntax) Python is probably easier to pick up than Java.

> 2.  Is going from object-based to object-oriented programming that huge a
> jump?   I want to learn an OO language, however I plan on utilizing it in my
> career.

OO concepts such a polymorphism are pretty important, and I'm not entirely
sure if VB supports it (though I heard it is fully OO now, so it should now,
and there's COM of course). Anyway, OO concepts in the context of Python
aren't that hard to pick up; it comes fairly natural.

> 3. Which one is the most "fun" to program in?

Python (you are asking in the Python newsgroup, right? :). Definitely
Python, though. Python's more interactive, its syntax is more concise and
still more readable, and it doesn't bother you with a lot of static
type checking, which Java definitely does.

> 4.  Is Python multi-platform?  How is it's performance compared to JAVA in
> an internet situation?  It's reliability?

Python's very multi-platform, though it takes another approach than Java;
the idea is to stick to the wide range of modules that are available 
cross platform if you want to make a cross platform Python program. There's
absolutely no problem moving from Windows to Linux, for instance, if
you do that.

Performance depends on the task you're performing. In theory, Python is
slower than Java. In practice, it's often faster. How can that be? 
Various reasons:

  * Python extension modules are in C, and therefore pretty fast, whereas
    Java has the tendency to do everything in Java, which tends to be slower
    than C.

  * Python code tends to be more high level than Java code, and it's easier
    for programmers to come up with smarter, faster, algorithms.

  * The startup time and overhead of the Python interpreter is smaller than
    that of most Java environments.

I've used Python extensively for internet programming, in the context of
Zope (http://www.zope.org), which is written in Python.

I've experienced no reliability problems with Python to speak of. It doesn't
seem to be an issue, generally.

> 5.  Do you for see Python as becoming a major player like Java servlets and
> MTS?  Can you see Python demand outstripping Java demand in 2 years time?

It's possible. I wouldn't make predictions like this, but let's say that if
people were smart this *would* happen. :) I do see Python's mindshare growing
though; 2 years ago you'd see far fewer references to it than you can see
today, for instance. There were also far fewer books on it.

> Many of these questions are in response to a post I saw earlier where Python
> was being touted as the next evolution of OO programming.  It went something
> like...
> C --> C++ --> Java --> Python.

I skipped Java myself. I've used Delphi, though, so perhaps my evolution
is comparable to that. It's not as if Python is a revolutionary OO
language; it doesn't introduce revolutionary new concepts (but neither
does Java, even though people seem to think it does). Python is very
nice in that it integrates OO without really forcing it on you, instead
making it natural. It provides just enough syntactic sugar to make it
easy on the mind, but not enough trickery to make it hard to remember it
all.

> I'm really interested in hearing from VB programmers that decided to jump
> into one or both of the languages,  has pretty good knowledge (enough to get
> a Java or Python job) and the headaches and experiences they had learning
> about them.  Do you need a formal CS education to grasp them?

I wouldn't think so, but in either case it'd help. An informal CS 
education and a curious mind are definitely enough, though.

Good luck!

Martijn
-- 
History of the 20th Century: WW1, WW2, WW3?
No, WWW -- Could we be going in the right direction?



More information about the Python-list mailing list