Do I really need to learn Java?

Remco Gerlich scarblac at pino.selwerd.nl
Mon May 14 08:50:14 EDT 2001


Hanna Joo <hanna at chagford.com> wrote in comp.lang.python:
> Hi, I am a newbie python programmer who ended up in programming without much
> previous experience in this field. My team wrote a small system in python
> (not understanding objects at all - it is horrible with globals everywhere
> ^__^ ) which works quite well. It was an experimental project and many will
> cringe if they see the program.
> 
> After this project, I studied python more in depth, and started writing
> simple programs using OOP concepts. Then a friend of mine studying CS
> suggested that I study Java instead of "not well designed (!!!!)" python to
> master the concept of OOP.

Your friend probably had experience with Java, none with Python, and had
heard a lot of hype. Disregard. Python's design is not perfect (those
languages are extremely rare) but it's way better than Java's.

Particularly, the idea that OO means "*everything* must be a class" is
rather misguided. Java is class oriented, not object oriented per se.

> I don't know much about languages to discuss their merits in depth, but to
> me, a newbie, python offers all that I need. Although I find Java and C
> interesting, I am not sure whether they do what I cannot do in python. I
> would love to learn other languages to broaden my horizon, I would like a
> language as clean and flexible as python (strong bias here as I know only
> python well)
> 
> Can somebody explain what the advantages/disadvantages of using Java (or
> C++) compared to python? And whether I will have to use Java in certain
> situations?

Java is more strictly typed. That's more programmer trouble, but it may have
some merit in big systems. Python is faster to program in though. If you
want to make a prototype in Python first and then make a "for real"
implementation in Java, it seems to me that C++ would be more to the point.

There has been a lot of hype surrounding Java, which is by now a point in
its favour - there are *many* libraries available, commercially, for lots of
different things. Python has loads, mostly free, but not *that* many. Maybe
you want to do something for which there are only Java libraries. If you
don't want to pay for the libraries, this point isn't so relevant.

Also, Java syntax is more friendly to people who only know C/C++ and are
scared of other things.

Python integrates better with Windows though, good COM support, soon there
will be .NET - if you're into Windows scripting, Python is far better than
Java.

Python is more cross platform. Python binds to more GUI frameworks. Python
is Open Source. Python has the best online community of all. Python's design
makes more sense.

Java has its place, it's not a bad language, but there's not a lot of things
that it really shines in. You should probably learn it since it's still
quite ok to program in, and the more languages you know, the better. But you
know Python, and for most purposes, Python is going to be at least as good.

Java is also fun to code in. It's just that Python is more fun :-)

Java is probably a lot faster than Python, I don't know. It seems to be you
would use neither if speed is crucial.

Above all, forget the idea that one language is better than the other, and
that you have to feel attacked if someone likes another language. They all
have merits.

-- 
Remco Gerlich



More information about the Python-list mailing list