by api · 12y ago · 0 comments
https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpris...
I think the over-engineering is an unintended side effect of Java's most attractive features: incredibly stable standard ABIs, portable byte code, fantastic tooling, and a language that makes byzantine abstractions relatively easy to implement without the instability you get in C++ or the unmaintainability you get in dynamic languages. Sometimes you actually do need very high level complex abstractions, so this makes Java a fantastic language for those cases. But those cases are rare. Java makes it easy to build towers of babel that stand up, so they happen.
Java can be fine if you exercise discipline around complexity. Java coders need YAGNI and KISS tattooed on their inner eyelids more than coders in other languages.
C: pointers-to-pointers-to-functions, type puns, and quasi-opaque "types" with really_long_identifiers_t everywhere (among many other possibilities, and bonus points for numerous reimplementations of basic data structures tailored specifically for different types without significant performance gains)
C++: see Java, but in C++ form; or alternatively larded with metatemplate programming
perl: write any valid perl, because it parodies itself
python: mishmash classes, functions-as-stateful-objects, and n-levels of decorators everywhere, and toss in some metaclass programming for giggles
And so on.
(Note: my favorite language to program in is currently C++, and I'm well aware of the less desirable traits of the language and codebases that exist.)
Had a memory leak happen in Java once, had the proper tools already, didn't have to interrupt a live server or anything, plus the tools were easy to use and well documented.
Really the problem is that when you program in Java, you need to restrain yourself. You could create another level of abstraction, or you could just solve the problem at hand and abstract it later when you find a concrete case for it. And guess what, when you get there, you've got excellent tools for it.
That's clearly a DR: one of the major headings is "The Java Language Kinda Sucks".
More accurate summary: Java as a platform is not bad, the problem is that the platform is popular enough that lots of less-than-skilled people are using it, and making lots of less-than-ideal choices about how to use it -- including failing to use the tools available in the ecosystem to streamline the experience (and including, as a subset of that, choosing the wrong one of the languages available on the platform, including choosing the Java language itself when its not the best choice.)
IMO the best thing about Java is the interfaces and libraries. When you want to reuse some else's code, just looking at the public methods and their type signatures makes it basically self-explanatory. This is what I miss most when I'm working with dynamic languages like JS, Ruby and Python.
I believe though that you can make poor library choices in any language & framework. With languages that have been around for a while, there are a lot of bad libraries...
I don't know what happened with JAX-RS 2. It feels like the J2EE team got hold of it...
(PS Thanks for the Ninja suggestion; I will check it out)