Friday, February 11, 2005

Java may not be that bad after all

There is a popular belief (which I'm not going to argue with) that programmer's productivity in Java is "inferior" to that in more dynamic languages, like Python.

That's OK but Python seems "inferior" to Java when it comes to innovations (in the environment, not in the language itself). There are countless (ok, shall I say many?) python packages which started as a port of some Java library. Those that come to mind first: unittest and logging packages, which are now even part of the Python standard library. Other examples: PyContainer, PyFIT, Cheetah, you name it. To some degree, larger frameworks often borrow as well: WebKit (servlet, request/response architecture), pyworks (similar to webworks), probably others.

Sometimes this pale imitations evolve into more pythonic things, sometimes it got replaced by built-from-scratch better alternatives (like, say, py.test). Of course, there are genuine python packages which shine even compared with the brightest Java counterparts (Twisted comes to mind first), but these are comparatively few.

The ideas' circulation between languages/platforms is a good thing and there is nothing wrong with it. Still, why Python-Java relationship are so asymmetric? Is it just reflects the difference in size of the respective communities? Is it something else here? Or are my perception skewed?


Anonymous Ä˘irts said...

Have a look at evolution of Java. It looks more and more like Python with each version.

11:51 AM  
Anonymous Sridhar Ratna said...

Python has twisted and nevow! Java?

12:28 PM  
Blogger Baczek said...

Twisted is a good example and a great package, but it really doesn't fit Python IMHO. Lisp is something Twisted would shine in.

12:37 PM  
Anonymous Anonymous said...

Maybe java should follow python in terms of :
1) portability of the vm/interpreter/jit
2) speed (an low memory consumption)
3) have a free implementation

and then we'll see again.

12:47 PM  
Blogger Kevin Dangoor said...

I'm not sure of the exact lineage, but I think that JUnit actually originated in Smalltalk. Certainly, the famous C3 project was in Smalltalk and involved writing unit tests.

The Java universe is an order of magnitude larger than that of Python. Yes, some ideas of have ported from Java (LuPy is another example). But there are many more nasty, crufty Java open source projects that don't get ported to Python.

The reason Python libraries don't get ported to Java is that it's too hard. Good Python libraries tend to provide great APIs by using Python's features like setattr/getattr, setitem/getitem and the newer metaclass hook. It's very easy to move an idea from Java to Python, but much harder to go the other way.

Anonymous: Java has higher memory consumption than Python, true. But, Java is much faster than Python... I wouldn't try to call Java out on speed.

4:55 PM  
Anonymous Drew Perttula said...

"there are .. python packages which shine even compared with the brightest Java counterparts .., but these are comparatively few."

And what could be better than having a small number of shiny packages? You talk like the number of good packages should compare equally with the number of bad ones.

6:17 PM  
Anonymous Anonymous said...

Perhaps Java has a larger and better community process focused on many aspects of the language.

6:31 PM  
Anonymous Anonymous Tweet said...

My (admittedly limited) view is that the Python community sometimes suffer from internal NIH mentality. For each great idea, there will be plenty of alternate implementation, one more elgant that the other.

If Python folks were more interested in using and improving existing packages, there would be mindshare to spare to invest in thinking about new cool and innovative stuff...

10:09 PM  
Anonymous Anonymous said...

For all of Sun's posturing around opening Java and Solaris both are still closed and owned by large multinationals who have a duty to make money for their shareholders.

Personally I think Java is the Cobol of the 1990s. In 20 years time people will be still using it to maintain legacy apps but the majority of the world will have moved on to something that probably looks like python combined with lisp.

4:35 PM  

Post a Comment

<< Home