Enough Piling on Java

There’s a trend in the programming world that bothers me. A technology or product will get popular because it solves a problem well. Then, as something new and more exciting comes out, we relentlessly mock the old technology as if it never belonged in the world. This trend plagues Java.

Why does everyone hate Java? We feel compelled have a hateful disclaimer whenever mentioning Java - “I first came across this pattern in Java, and trust me, I hate Java as much as the next guy, but that’s when it first made sense to me.” Or worse, many of the people that I hear abhorring Java have never even used it!

Java was a great language when it hit the market. It was the first language I can remember that was really hot. Programmers bragged about working at a forward looking company where they were empowered to use Java. Really good products were built upon Java, and still are!

It’s a weird sort of nihilism to dismiss every thing that came out of Java just because the language is not en vogue anymore. The more mature attitude is to learn what Java does well, and carry that forward. This goes for any technology - know what problems it solves well, and what problems it struggles with. Languages are just tools, neither good nor bad.

Even if you actually used Java, and really hated it, wouldn’t it be more productive to say, “I moved on to language ABC because I found that it enabled me to do XYZ, which I couldn’t do easily in Java.” If you ask someone why they hate Java, they often don’t know. Or, they have a generic response regurgitating something they heard like, “Uh, well, doesn’t it, like, overuse the Factory pattern?” Or, “Uh, well doesn’t it take dependency injection too far?” Is that really a reason to hate a language w/ vitriol? Is there any reason to hate a language with vitriol?

I’ve suggested to many Rubyists that they should learn a strongly-typed, compiled language, perhaps even Java, just to see how it’s different. I think they should have an informed opinion based off of writing actual code. See what a compiler brings to the table. See the speed and performance improvements. Experience the tooling, especially around refactoring. See how design patterns are more easily brought to life when you can count on a type system and compiler to enforce some rules.

Strong typing has come into favor again lately, and I hear many Rubyists and JavaScripters talking about it as if it’s a groundbreaking idea. They are impressed with the class of errors that they no longer have, and the reduced test burden that they now benefit from. Clearly these are groundbreaking ideas from TypeScript or Haskell, but surely not the dreaded Java, or the long lineage of strongly-typed languages before Java!

PHP, Wordpress, IE, .Net, Flash, Cobol, Bootstrap, Backbone, jQuery, and hundreds of other oft-made-fun-of technologies, are still just technologies - they have pluses and minuses. Please, let’s have a more mature attitude towards the progression of tech. Our industry moves forward when we carry forth the good parts, and leave the bad.