Painfully HTTP Java

February 11, 2009

I have been working on AtomPub and coding a prototype over the past few evenings to get Apache Abdera talking to CouchDB. I know there is an experimental adapter in Abdera for CouchDB, but it does not use CouchDB the way I need to.

I decided to write my own provider, workspace manager, adapter, etc. I have been using couchdb4j, the Java library binding used to talk to CouchDB, and json-lib, a JSON library for Java.

Why, it has been really especially extremely very painful!

HTTP and JSON, REST a bit, and to a lesser degree XML, are supposed to be technologies that make your life easier as a programmer and as a server. But with Java, it's the other way round. What should be easy, becomes complex. I am very disillusioned about the suitability for the Java language in pretty much any domain related to HTTP.

With Java in HTTP, you have to jump API hurdles, pull hundreds of dependencies, and end up with stack traces deep as a black hole. Yeah, it works, mostly because of the amazing development support and tools for Java, such as Maven and Eclipse. But that alone does not make Java a viable technology for programming HTTP.

Java has it uses, and it is a good programming language. I don't think I'd ever code C++ again if I could use Java. But that's more on the number crunching, for the Hadoop of this world.

I'll stay with my PHP, Ruby and Python while I can. Perhaps it's also time to learn a functional programming language like Erlang.


blog comments powered by Disqus