There’s something wrong with Java developers. I’ve been working with Java now for over 10 years. I’ve also had the good fortune to work with a number of other languages as well - C#, C, C++, Python, Lua, Objective-C - which I think has helped immensely in understanding where Java developers are going wrong. A lot of people say Java is a terrible language. I disagree. Java has its faults, but I think when you look at what it is in particular that ticks many people off it’s not the Java language per se, but the way it’s used.
The biggest problem I’ve encountered over the years looking at Java code is that it always seems to be the product of someone who fancies themselves as an architect. They must, because so often I find I’m reading code that looks more like a plan for something that solves a problem, rather than something that actually solves a problem. It’s not a subtle distinction. There are deep layers of abstraction and mountains of boiler plate code. Object Oriented bastardy is put to maximum effect. It’s not the kind of code you can skim read and understand what’s going on - you have to dig deep, you have to learn a whole new vocabulary of abused and tortured words (“AbstractAdapterFactory”), you have to become part of the system. I can’t recall the last time I looked at a non-trivial project using Java that didn’t have this disease.
There are a couple of reasons why things seem to always end up this way in Java land. Java itself must share some of the blame. The Java platform APIs exhibit the above problems and so the earnest developer following the generally good principle of adopting the style and convention of the standard libraries is immediately led astray. Java also forces a high level of formalism and verboseness on the developer, so much so that you eventually just get used to it and other languages feel naked without it - Stockholm syndrome kicks in.
The OO craze has a part to play in this madness as well. More and more developers are stepping back and realising that as a programming paradigm, OO is actually pretty shit. Yet Java is maximally rooted to the OO paradigm, and seems helpless without it. Even today you’ll still find a strong bias towards OO courses being taught at the university level using Java, and the bias was certainly stronger 5 - 10 years ago.
It also does not help that Java is a very popular language that was broadly adopted and used in the enterprise. Let’s be frank - much of the Java code that you might see in the wild is the product of very low quality developers.
Sadly, the problem extends beyond just code as well in to entire Java developer ecosystem. Whether you’re using Java unit testing frameworks, dependency management tools, mocking frameworks, etc…if there is even a whiff of Java, you’re fucked. Java developers just can’t help themselves it seems - give em an inch, and next thing you know you’re looking at a OO hierarchy 15 layers deep and instantiating a hammer hammer factory.
A personal plea
Today I’m learning Gradle, because apparently it’s the flavour of the month for Android development. Gradle comes from the Java world and so shares all the standard problems I discuss above from being infected with Java. As Tim Bray recently lamented
“I have a tab open to a page in the Gradle docs: Chapter 50. Dependency Management. It has 63 header-delimited sections organized into 10 top-level subsections, and it’s chapter 50 of 65 (plus five appendices).”
Android - really the biggest reason today why anyone besides the enterprise guys cares about Java anymore - is well down this dark dark road as well. It’s increasingly common to read a page of Android API documentation and have no idea what the fuck it’s talking about initially. You get there eventually of course, you just have to take a detour through 17 other classes. What, you can’t handle that? You obviously lack the perseverance and vision to conceptualise this grand cathedral that has been built to populate a list. Loser.
The engineers at Google working on Android are too busy architecting grand frameworks for solutions and not busy enough solving actual problems.
I’m an Android developer, stuck using Java. It’s breaking my heart.