Rating 26 years of Java changes
31–40 of 327 posts
Re: Rating 26 years of Java changes
#32Can someone explain why developers like var?
Re: Rating 26 years of Java changes
#33Earlier quoted context omitted.
Well, it was annoying until autoboxing came in. // Before autoboxing list.add(new Integer(42)); // After autoboxing list.add(42); Mostly it's a non-issue now. If you're desperately cycle/memory constrained you're likely not using Java anyway.
You can get pretty good performance out of Java these days, so long as you know to avoid stuff like boxed primitives and the streams api, as they generally have god-awful memory locality, and generally don't vectorize well.
Edit: actually, if someone here is using it for something like that I'd love to hear the rationale...?
Re: Rating 26 years of Java changes
#34Re: Rating 26 years of Java changes
#35It appears that most of the good changes are imported from C#.
Or Scala. Or Kotlin. Or any of the other languages that had most of these features years if not decades before Java. ;)
It hasn't worked out in terms of delivering perfect language design, but it has worked out in the sense that Java has an almost absurd degree of backward compatibility. There are libraries that have had more breaking changes this year than the Java programming language has had in the last 17 releases.
Re: Rating 26 years of Java changes
#36Re: Rating 26 years of Java changes
#37 Integer a = null;
int b = 42;
if (a == b) {} // throws NullPointerExceptionRe: Rating 26 years of Java changes
#38Definitely underrates the impact of annotations. I'm personally not a fan of the way annotations are used to implicitly wire together applications, but I have to admit the impact. Maybe 5/10 is fair in light of the wide range of positive and extremely negative ways annotations can be used. So many of these features were adopted after they were proven in other languages. You would expect that since Java took such a sl…
It's seriously puzzling. I just don't get how it's possible to look at what so many others have done better, and somehow design something worse. For what reason? Consistency with the rest of the language, possibly? But is that really so important. Do they just not want to tackle certain parts of the compiler?
Also there was a long period when changes were very lumpy - it could be multiple years for a feature to make it into the release, and anything that might screw up other features got a lot of pushback. Then other conventions/tools emerged that reduced the urgency (e.g. the Lombok stuff)
Edit: I should add that it's now on a fixed 6-monthly release cycle which IMO works much better.
Re: Rating 26 years of Java changes
#39Can someone explain why developers like var?
It‘s a harmful code smell: It often obfuscates the type, forcing you to actively check for the type and should not be used.
Generally, you save some keystrokes to let other people (or future you) figure it out when reading. It seems like bad practice altogether for non trivial projects.
Re: Rating 26 years of Java changes
#40I will acknowledge that the interface is a bit weird, but I feel like despite that it has consistently been a "Just Works" tool for me. I get decent performance, the API is well documented, and since so many of my coworkers have historically been bad at it and used regular Java IO, it has felt like a superpower for me since it makes it comparatively easy to write performant code.
Granted, I think a part of me is always comparing it to writing raw epoll stuff in C, so maybe it's just better in comparison :)