Howardism Musings from my Awakening Dementia
My collected thoughts flamed by hubris
Home PageSend Comment

What's up with Java?

The other evening, a friend of mine starting bitching about Java. It isn't too difficult to do, especially now. He is a highly intelligent individual who can talk about the database theory as well as program firewall table rules… but building things in Java is frustrating.

In his own words:

I am very very very disappointed in the Java community right now. They have invented a thousand elaborate ways of making problems they are intending to solve far worse. App server incoherence and complexity, the excess of Jnn<n> acronyms that don't describe anything meaningful, and the overall sensation that Java development tools (at least as I read through it in the filter of the jguru and theserverside) are a one big circle jerk. If what I've surveyed is the best and the state of the art, it's desperately wanting.

I agree. If someone wants to start building large scale projects in Java, I'm not sure where I would point. I wrote him back a little "there-there" empathy email and started with an inaccurate history of programming languages…

Once upon a time, there was C, and it was good and we really had a good time. However, the biggest failing was in the library and the lack of standards. Everybody had one. So we got ANSI to help define one, and they did (which was a big help), but they also bastardized the language in the process. No big deal, it was still pretty good.

Then C++ came on the scene, and it had some very nice features, and while it did have a somewhat standard set of class libraries (template aside), it wasn't enough as it didn't standardize a lot of stuff like GUIs and whatnot that were really important at the time C++ got popular.

Then Java came along, and along with defining the language, it specified the base library as well. Fab. This was, during v1.1 times, the most practical language to me. I think it inspired a lot of people… especially since the web and internet were just taking off in a public way.

Pretty soon, groups like the XML Subgroup within Apache were building reference implementation of their projects first in Java and then in other languages. It seemed like a logical choice. Pretty soon, 3/4 of Apache is Java projects… and some of these overlap. Significantly.

And now for some bad points against Java …

  1. It needed to maintain some backwards compatibility. Java initially had these "streams" for doing IO and they were pretty good, but didn't deal with character encoding very well. So, we came up with "readers" to address that. A reader can take a stream, but a stream can't take a reader. Consequently the "streams" became deprecated. This is all fine and good except that the rest of the library (and 3rd party code as well) that had been built to accept a stream haven't been updated to take on a Reader. This same thing has happened elsewhere, like with Date and Calendar, and the Collections package. So a person new to Java will have to learn and write two different ways of doing the same thing … one using deprecated code.

  2. As the number of developers, companies and projects increase, the size of this standard library also increases. This is nice on one hand in that there is lots of code to take advantage of, but the downside is trying to learn it all. At one point, I had it all down… I knew and used every library… but not now. So a new person coming into Java would definitely be overwhelmed.

  3. The internet, which fosters communication, can actually be quite distracting. Everyone has a person style/taste for how web pages should be done, so they all clamor for equal attention. A person new to Java will now have to wade through these to find their own opinion as to what is the best of breed. Eventually, you would think, most of these go away and the winners will stay. But the problem with things like JSPs, is it might not be the best (it's actually the worst), but because so many commercial projects are based on it, we just keep putting bandages on it, instead of killing it and starting with something better. Can you imagine that we are now adding a server-side scripting language to JSPs which already has Java as a scripting language … and we're doing this in web pages which shouldn't have any code in them to begin with? Madness, I say.

How to proceed? That is a good question … There is a book that echoes my sentiments, Better, Faster, Lighter Java. In here, he claims that we often need to reexamine at things with fresh eyes and realize that our "job" is to build things and not spend most of our time working on the scaffolding.

So I might start a riot here, but perhaps we can throw off EJB shackle and check out Spring and Hibernate (read this article while you're at it) … let's get rid of these complex JSPs and go back to a simpler, more maintainable system, like Freemarker.

With all of the complexity in the world that is Java, I can now start to see a clearer path through the jungle that began long before [last year's complaint]8.

Tell others about this article:
Click here to submit this page to Stumble It