3 ms·
A lot of modern Java libraries and frameworks got better, and the Java standard library itself is moving away from deep class hierarchies, but I think there's a
by unscaled 7y ago
A lot of modern Java libraries and frameworks got better, and the Java standard library itself is moving away from deep class hierarchies, but I think there's a long standing culture that dictates how Java is "ought to be written" and it's quite hard to dispel that.
A lot of this is the language's fault though. For the sake of "simplicity" Java decided to:
1. Have a bifurcated type system with boxing, so a lot of generic code had to be obtuse or use a lot of reflection (It took a long time before Java added a very flawed generics implementation and convenience functions like Strings.valueOf()).
2. Disallow standalone functions (everything has to be a method on a class).
3. Implement many standard library APIs as abstract classes (and worse - concrete non-final classes) instead of interfaces, encouraging developers to overuse inheritance where composition should suffice.
4. Not provide any mechanism for delegating to member objects.
5. Encourage the practice of getters and setters, but provide no mechanism for properties.
6. Provide neither powerful meta-programming mechanism nor a strong type system, but create a powerful reflection API instead. Any surprise it will be misused?