Why I Hate Java

16 May '06 - 14:57 by benr

Java sucks. I've been anti-Java, and more so, anti-OO for a long time. Some of the arguments I've had reguarding OO have become legendary, at least in small circles, most notably at Linux10 (the 10th birthday of Linux) when I threatened to beat down a KDE developer who was defending C++ and QT by beating him with Nova (I'd hold Nova out and she'd claw at him, it was hillarious). But as I grow and learn as a technologist, since thats fundamentally what we all are, I continue to feel that since so many people love OO that I'm clearly missing out on something... but what, I don't know.

This all sort of came to a head about 3 weeks ago at a Sun Executive Briefing thing that I attended. This was a customer event, small and simple, with an all star cast, including Jonathan Schwartz, Tim Marsland, James Gosling, David Yen, Stephen Hahn, Noel Hartzell, and many more. I was there, unofficially, representing OpenSolaris (I got an invite as a customer, just like anyone else). I walked around talking to customers that were shy or looked like they needed some help, introducing them to people and all that, it was fun. One moment that really struck me was when I was talking to a customer about Niagara (T2000) and he asked "Have you used Java on it?" and I gave my stock "I'm not a Java fan, I don't use it." I didn't go into my full all-out "Java sucks..." routine because since I was sort of representing Sun I didn't want to bash a Sun technology in front of a customer at a Sun event.

The important detail I'm leaving out is that this conversation occured within ear shot, about 5 feet, from James Gosling. As I was speaking I could see him out of the corner of my eye, and I'm fairly certain he heard me. Following that, I didn't feel as though I should go and shake his hand or something. I didn't really dis him or Java, but my comments about Java were so light hearted that it didn't come off well. Following this, for about a week or so, I really felt shitty. I shouldn't have, but did. I couldn't help feeling that my belief that James Gosling is one of the most important technologists of our age and my belief that Java sucks, are two things that are seemingly incompatable. The truth is, that while I don't promote it, Java is an entirely useful thing... its just not useful for me and 90% of the Java apps I've used in the past were slow and generally lame (SMC being the most damning example of a Java app). As a long time C programmer I prefer traditional toolkits like GTK+ and EFL.

So I started to think that any rational person in my place would sit down and once and for all make a list of all the things that I think I don't like about Java and then begin to challange those things. After doing that I set out to better understand Java, because if you hate something without understanding why, your (I f**king hate this word) "ignorant". I don't want to be ignorant, if I'm going to hate Java thats fine but I should at least have a much better reason for it.

So here is a list of reasons I can't stomach Java:

  1. OO Sucks: In fact, when I stopped and looked at it, its not OO itself that bothers me, in fact I use OO concepts in C all the time. My problem is typically with the implementation of OO languages. In PERL, C++ and even PHP, OO seems like a bolt on accessory and doesn't really jive with the benefits those languages offer. It was only when I started to use Ruby that I felt like maybe this OO language business wasn't so bad after all. When it comes to Java, class declarations and method names can get huge and nasty, which is a big discouragement to me. I don't think you could even create a Java Refernce Poster anymore, its too huge. C, by contrast, is simple and elegant, imho.
  2. Branding Hell: There is a massive barrier to Java development, that being this incredable learning curve. Learning "Java" as a language isn't the problem actually, its all the other stuff. You think "Lets learn about Java!" and suddenly get barried under a pile of terms like JavaBeans, EJB, Hibernate, Ant, JSP, Tomcat, Servlets, Scriptlets, Struts, AWT, Faces, JDBC, POJO, JDO, Seam, Shale, Swing, and on and on. Just figuring out what you should download is a pain in the ass, J2SE, J2EE, J2ME, JDK, JRE, SDK, etc. Sure, many of you are laughing at this point, but when your new its a horrible feeling to be confused before you've tried to write "Hello World"... and if your thinking "Don't worry about it yet", its easy to say when you know what all that is and you know how it all plays together.
  3. OO Distractions: Not only do you need to learn Java, all the componants and branding terms, you also need to learn UML, understand "patterns", MVC, SOA, and all those other concepts and practices to really get your hands around things. Its absolutely daunting.

Those are my big 3 complaints. Clearly, "Java: The Language" isn't my enamy, its all the stuff that is built up around Java that bugs me. If your moving from the world of C and PERL its tough enough just to really get your head around thinking in OO terms and how you need to change your thinking, to then be bombarded with all this other crap is enough to make you throw a java.lang.FuckThis exception.

But... despite all this, I still feel like I'm missing out on a big part of the world by not taking the time and effort to tackle all of this. And so, I'm doing just that. I now understand Java Server Pages (JSP) and finally get what Apache Tomcat is all about. Its one thing to "know" what something is but its another to "understand" what its all about. I'm now moving from knowing to understanding. I still don't like Java over C, PERL, PHP, or Ruby, but the pieces are slowing coming together.

I know my blog is mainly focused toward SysAdmin for Solaris and Storage... but if people are interested in some of my journey along the Java path, let me know (via email preferably) and I'll perhaps chronical my journey and try my best to simplify all this crap into something far simpler to understand and ramp up on.


- - C O M M E N T S - -

There is nothing to add to point number 2 but just to agree with it.

Noorul - 16 May '06 - 15:47

AMEN!, I too share the frustration. Only not against java so much as the poor implimentation by SE’s. In my shop it’s a struggle every day because SE’s insist quite heavily on GC to clean up their mess .....and then they wonder why we need 8gb of memory to serve a friggin’ web page…....

Shane (Email) - 16 May '06 - 15:49

Not to mention branding where someone thought they’d just toss “Java” onto a product name:

Java Desktop System (eh? its GNOME!)

iPlanet, er Sun ONE, er, “Java Enterprise System” – I recently migrated from NIS to LDAP using the “Sun Java System Directory Server” – other than a management GUI, Java has nothing to do with it!

There’s good Java apps (Azureus), and bad java apps (SMC). It’s all about the programming. Unfortunately, rather than impress with “lean and mean” Java-based management GUI apps, Sun lets the bloat grow.

Bill Bradford (Email) (URL) - 16 May '06 - 15:57

Well, first of all, the Sun naming of products (Java Messaging Server, Java Directory Server, JDS, etc) it’s stupid. There’s no other way to say it, it’s stupid but, truth be told, I hope they don’t change it. I prefer to stick with a lousy name than to keep on changing.
I am NOT a developer and, from a systems side, I tto hate Java, specially when a program fails and, unlike with C where you can actually understand what’s happening, good luck doing it with Java (just try to truss a java app and see). but, from where I see it, Java has 2 very big advantages: – There are games in the market with simultaneous releases for Windows, Mac and Linux. Those games are made in Java ( In Schwartese, Java is driving Unix / Linux adoption in non tech end users) – All of a suddent, you have one and only one way to deploy an Active / Active cluster. The developer writes to the App. Server and the sys. Admin / Infrastructure Architect does the HA of the App. Server, proven, auditable and repeatable configurations.
I’m not sure this 2 reasons can overcome the down sides but, they sure are critical

Jaime Cardoso (Email) (URL) - 16 May '06 - 19:26

Tell me about it…,
I’ve just finished University (BSc Computer Science) and I’m still playing catch up with all the new things I have to learn in java. I know what jsp is as well as tomcat as well as servlets. I know a little of MVC, but the rest of it is still daunting even for people who already know java.

I’m still a fan of C, C++ but it seems java is just very popular interms of web applications. I’m just surprised I dont hear so much of this MVC, Design pattern stuff with .Net maybe it’s something I should look into.

But you definitely have a point java is a big pain, atleast for first timers. I’m not a first timer and I still have so much to learn. It definitely is a pain in the ass. I like to think of Java as the big hipped woman that just seems to get into the way of trying to get things done in a simple manner. And C/C++ the shiney little black box that just does its job.

Irfan Gulamali (URL) - 16 May '06 - 19:43

Just figuring out what you should download is a pain in the ass, J2SE, J2EE, J2ME, JDK, JRE, SDK, etc. Sure, many of you are laughing at this point

Amen to that, I am laughing with you on that one…

:)

I think the biggest issue with Java is not it’s license, its speed or it’s portability. It’s the fact that you have to study the intricate details of java dev just to get a bloody runtime installed on your system

che kristo - 16 May '06 - 23:29

To me it just sounds like you’re trying to run before you can walk.

All those complaints you level at Java can be made about any language. C is certainly not “simple and elegant” – especially when pointers come into the mix. How are all the different libraries you can use with Java different to the different modules you have with Perl? Not to mention that Perl is pratically unreadable! There is nothing wrong with OO at all. AOP, on the other other hand, can fuck right off. No-one can really come up with a decent scenario where it can/should be used and all the exmaples you read about are so noddy that you wonder what all the fuss is about. And to diss MVC? That’s just a design pattern. It’s good practice in ANY language.

Now, I’m man enough to admit there is a lot of shit in Javaland. Much of it has been spewed forth by Apache (Tomcat/Struts/Axis all suck hairy man-balls). The OSS Java “community” is one big circle jerk – but I’d say it’s a lot more level-headed that the Ruby crowd and their sodding Rails obsession! RoR doesn’t even have a stable, production-ready container! I’d be tempted to give it a go if all the zealots just shut there mouths for 5 minutes.

Right, you hate Java but you don’t use it. In my book you that gives you no grounds to slag it off. I’ve tried C and Perl, neither of which make any sense to me. Hell, I wrote a script recently that should have been dead-simple in Perl but since I couldn’t make any sense of it I reverted to Bourne Shell. C is way too low-level for my liking. C++ was always more comfortable to me but I’d still rather write in Java over anything else.

Oh, and learning Java isn’t the headache you’re making it out to be. Reading the comments it sounds like everyone seems to be trying to utilise the J2EE stack a week after writing a “Hello, World” application. That’s just stupid. You wouldn’t get me trying to write an Enlightenment application as my first “proper” foray into C.

Rich - 17 May '06 - 05:11

I strongly agree with Rich.
I had to learn making web applications in a very short time a year ago and i still don’t have enough knowledge to do it on my own from the scratch.
But this is the case with all big frameworks. What makes java especially annoying to the newbie is naming of components in the web context. There seems to be no clear definition of the terms, which all developers agree on.
Since i have ported a php-Site to j2ee/jsp i don’t hate java. Java/Jsp makes modularity more easy. Codevelopers feel the need for comments, indentation of lines and meaningful names for variables.
This can be done with scripting languages too, but most developers tend to do big all-in-one hack modules without comments, if they use script languages. There is no reason for this behaviour, but this is my experience.
To come back to java and the web stack: It is not an easy to use web development toolbox, but it still works if things are getting bigger.

[Knut] (Email) - 17 May '06 - 06:55

I do not hate Java. Actually I love Java. But as far as OO programming I hate C++/C/ObjC. C++ have namespaces (good) but it isn’t C99, it is really complicated to learn, and why the hell do we need references AND POINTERS?
C is fast but it does not have namespaces.
ObjC does not have namespaces and although everything seems good you have to emulate exceptions, and the developer has to make naming conventions.

OO is not implemented correctly in the current setting. However I believe JAVA is a very good step, but it is very highlevel. We need an improved ObjC or a more primitive C++.

Java is very good at writing a lot of (slow) software. The worst problem is that developers that use Java are usually not well educated but pressed to make something (the eternal problem with companies which want everything without giving anything, like training). Java is not bad for RAD, its usage is shitty (like companies).

I prefer C but I have a lot of pressure to get the work done, quality and speed comes last. However the C99 specification should be amended to provide namespaces. It is very useful. Tcl/Tk includes namespaces although it is not OO. This makes things tolerable and Tcl/Tk is good for RAD scripting.

Java should have left the option to manage pointers.

And if you wonder why I haven’t mentioned C#. Just because :-)

Vasileios Anagnostopoulos (Email) - 17 May '06 - 07:48

Ruby for teh win!

David Richards (Email) (URL) - 17 May '06 - 09:37

Okay, I’m not going to agree or diagree or agree to disagree, but there is one thing Java brings to the table: garbage collection.

I’ve used a number of C libraries that manage their own memory and have bizarre APIs that try to hide that memory management while passing double pointers back and forth, which so graciously gives memory leaks that simply cannot be fixed in any sane way. This makes me want to go visit the people who designed those APIs and perhaps hide a fish in their office while they aren’t looking.

AC - 18 May '06 - 00:22

Java sucks dead bunnies through a bent straw sideways.

It’s a great concept implemented in the worst possible way. If Mr. Gosling only saw it in his heart to provide us with a language that can be easily compiled into binary code, and not design such a COMPLEX language, the world as we know it would be a better place.

I too share both your frustration and your belief that Java sucks. It’s too complex. It’s too slow, especially when run inside of a web browser.

Did I mention that Java is complex and slow?

Death to Java! I’d much rather go back to assembler, at least it’s simpler, tighter, order of magnitude faster… and I have to do the same amount of programming I’d have to do in Java, which is complete nonsense since Java is supposed to make it easy and abstract everything for me.

So I don’t care if James Gosling or Scott McNealy invented it, I would have told the guy straight to his face what I think. And I would have enjoyed it, too!

ux-admin - 18 May '06 - 03:09

My life’s been basically bland today. More or less nothing seems worth thinking about. My mind is like an empty room. I’ve more or less been doing nothing to speak of. Not much on my mind recently.

RuleZ023 (Email) (URL) - 22 May '06 - 01:00

I hate Java as well. Was the worst thing that could have happened to our industry and IMHO bred a calibre of programmer that doesn’t actually know how to program correctly !

Ron (Email) - 22 May '06 - 06:57

I’ve just been staying at home waiting for something to happen. Whatever. Not much on my mind lately. I guess it doesn’t bother me.

RuleZ023 (Email) (URL) - 12 June '06 - 23:37

I just don’t have much to say recently. Such is life. I’ve basically been doing nothing. Basically nothing seems worth bothering with. Oh well.

RuleZ023 (Email) (URL) - 13 June '06 - 12:56

Actually, i trust you have not used Java for a long time. Your points disliking Java are .. pointless. – you say OO sucks, because posibly you have not actually made any large or mid scale high level application. i am not talking about OS level stuff of small scripts. Posibly that is why you have never needed real OO. – The branding hell you mention is called “choice” in Java application developemnt. Come on, just becuase you havent actually used java, how can you start whining there are too many acronyms? Have you even tried to understand them? – OO distractions are usually buzzwords of IBM and sort. you dont need none of them when developing java.

i would suggest checking out IntelliJ IDEA one day. you will know what i mean.

afsina (Email) - 13 June '06 - 16:24

Not much on my mind these days, but what can I say? It’s not important. I just don’t have much to say lately. I’ve just been letting everything pass me by recently, but eh.

RuleZ023 (Email) (URL) - 14 June '06 - 00:37

Personal information





Remember your information?
Comment

Small print: All html tags except <b> and <i> will be removed from your comment. You can make links by just typing the url or mail-address.


^M