2 ms·
Problems I still have with Java: "new" keyword is basically introducing side effects, everywhere, making Java more difficult to test and confusing generations
by Supermancho 4y ago
Problems I still have with Java:
"new" keyword is basically introducing side effects, everywhere, making Java more difficult to test and confusing generations about how to do testing.
The primitive/object combination of int/Integer, et al is noise.
The reliance on annotations for modern development and the reluctance to put syntax in the language to codify obvious things. Basically requiring a pre-processing language (Spring) to do basic tasks, making development slower and more error prone.
The final keyword. The idea that you should sometimes take away developer agency, because you know the future, better than anyone. Classy.
The combination of Class Access Modifiers (which are for mixin property selection) with interface definition (what's this object's interface?).
The much acclaimed "java ecosystem" reinforces bad practices. 10 years later, PHP is derided for bad language choices but bad Java is handwaved as a series of missteps that has been corrected.
- mrkeen 4y ago"new" keyword is basically introducing side effects, everywhere, I don't think that's what it does. Unless you're talking about putting side effects into the constructor? confusing generations about how to do testing. Doesn't follow from the first part. The primitive/object combination of int/Integer, et al is noise. Somewhat agree. The reliance on annotations for modern development Sure, the Spring ones are horrible, but the Lombok and Jackson ones are pretty decent. put syntax in the language to codify obvious things What new syntax would you want? I guess I'd want to clean up the flatMap mess with some nice do-notation and <- arrows. The final keyword. The idea that you should sometimes take away developer agency, because you know the future, better than anyone. Classy. Final as a method keyword? Fair enough, but I don't think I've ever come across a method that I wanted to override but couldn't (I hate inheritance).. Final is also to try to make things immutable, but making things immutable in Java also takes more care than it should. The combination of Class Access Modifiers (which are for mixin property selection) with interface definition (what's this object's interface?). I don't get this at all. The much acclaimed "java ecosystem" reinforces bad practices. 10 years later, PHP is derided for bad language choices but bad Java is handwaved as a series of missteps that has been corrected. Maybe the language, not the ecosystem?
- Supermancho 4y ago> "new" keyword is basically introducing side effects, everywhere, >> I don't think that's what it does. From a java testing perspective, it does. There is no way to mock something that is new'd. This is a failure of the language. ie Python, p1 = MyClass() Now you have something mockable. > the Lombok and Jackson ones are pretty decent. They are, but they aren't in the language because Oracle (and the existing language development practices). Actual improvements are haphazardly added to java because 3rd parties already did the work, so why should they make the language better? Just use the increasingly obscure set of 3rd party additions.