I have been using java for the past…errr…6 years or so. It was cool back then and everybody wanted people who knew how to talk java, sleep java, and yes, even drink java while coding in java. 🙂
The problem is that the whole “write once, run everywhere” marketing campaign that Sun was force feeding the suits does not really work in practice. And the programmers knew that…but hey…who am i to argue with the pointy-haired-boss. So the whole dream of one language and one framework that you can write your tool in and get it to run on any device that supports the JVM was just that….a dream. The image of your refrigerator knowing when you’re low on milk and talking with your phone(bluetooth anyone?) to call the grocery shop never actually worked. Except for BillG’s house ofcourse, but then again…if i had that much money, i probably would spend my time coding my own dream language instead of looking for one.(i know…i’m a nerd)
A couple of years ago, i had the unfortunate chance to deal with J2EE in a big project. And let me tell you…i’d rather get my skin peeled off with a small tweezer than have to go through that again.
So skip to the current frame and you’ll see the following. Today, we have three flavors of java. We have J2EE for enterprise applications(nobody actually knows what that means), J2SE for the regular people, and J2ME for mobile devices. The smart people in the audience(or the really old) will also note that the promise of applets solving the problems of the internet at the time(that of interactivity and limitations of vanilla HTML) is no longer valid. Applets turned out too heavy for use at that time. No matter what you think the reasons for that is, the end result is the same. Nobody uses applets anymore.
The incredibly smart among you will also note that the graphical components in java have also gone under a lot of change. First we had AWT which was too limited to use and then we got Swing built on top of AWT. Swing was too heavy and had its own problems, which version 6 fixed a lot of. But it was too late and SWT was already quite popular.
I can go on and on, but without getting into a lot of technical details, let me tell you why i can’t use java.
- Java is still too heavy. It is very difficult to get a decent hosting company to run your application. The most they give you(if you don’t want to shell out for a dedicated server) is a tomcat instance that will be maxed out at 256MB. There are a few things that you can do to keep your memory usage under control and keep the performance but really the problem is still that java is too damn heavy. In fact, i understand why there aren’t a lot of hosting companies out there for it, its too difficult to offer under a competitive price.(Note: There was a project at Sun a few years ago that aimed at slimming down the JVM. The project’s long term goal was to create a diet version of the JVM that will load whatever it needed when it needed it. I lost track of that project, but the JVM for java 6 is definitely much better in terms of performance). .Net based language also face that problem with their runtime. But it does help when the OS maker and the framework maker are the same entity.
- The documentation is terrible. Really….It doesn’t matter if you have the best framework in the world when nobody can use it because your documentation sucks. After suffering from working on terrible projects with no documentation, i now have a severe allergic reaction regarding documentation and can sniff the good ones from the bad ones right away. The documentation often has too few details or is outright wrong. It really pisses me off when the documentation for the getAttributes() method only says that this function returns the attributes. Noooo…really….you don’t say….could have fooled me. Besides, there is one flavor of this getAttributes() that doesn’t actually return the attributes, but returns a reference to itself instead. How do i know that? Yup, i’ve read the source code. When you have to read the source code to know how something works instead of consulting the documentation then you’ve obviously done something wrong.
- J2EE is overly complex. Although i like the different components and the structure it imposes on you(some people consider this as a negative point though), some issues have been pushed over the border. A few years ago, i had the unfortunate pleasure to work with JAAS(the security standard) and i gotta tell you….that shit is too hard. We ended up not using it and instead implementing our own security system(the usual database based) and i believe that this is the path that most people use. To be fair, that project was a disaster. We were very pressed for time and i used to work 100-120 hours/week and also did administrator duties. So maybe i didn’t give it a fair chance.
- Although i said that i liked J2EE’s structure, sometimes i think that it is too restrictive. I am not entirely sure about this though, i still have not found a language that has a nice compromise. The structure of the language itself imposes good programming practices(i carried most of those from an old C standard) but when it comes to the class libraries, i feel that it gets too restrictive and thus it would take a lot of code just to do a simple task. For example, try to write a simple database manipulation program(meaning something that issues a few different queries for data…both DDL and DML) and you’ll see what i mean. To counter that, you’ll have to use some framework which brings its own complexity. Like i said, i am not entirely sure if this is a bad thing or not, i still rather enjoy oldschool C and a shell so i might be a bit prejudiced there….although it does make the initial phase of a project take a longer time and much more planning…is this a good thing or a bad thing?…You decide.
Initially, i thought that i would have more to say about Java. But i was surprised as i was writing that many of the problems that i see in it are not that bad actually. Ok, so it isn’t the best language, but it isn’t bad. And i guess this must be a good thing.