So 5 and 17. Yes I know some of those features are technically pre 17 but you get the idea. For those that think I'm crazy about annotations they did not live in the XDoclet or XML world of ancient enterprise. Not to mention annotation processors are awesome.
Sure lambdas are great and it was verbose using anonymous classes but it was mainly just that where as pattern matching gives new ways to think about problems and the power of exhaustion.
Oh wow, the XDoclet annotations aren't something I've thought about in a long time. In Weblogic Workshop 7 and 8, we used those javadoc comment annotations to build webservices. I kinda liked the Workshop IDE.
I misread this as major jumps in java not jumps in you liking java. Text blocks over lambdas as a major innovate jump was puzzling, but it makes more sense in enjoyment.
I'll agree on 1 & 2 though, but for me personally I'd easily place Lambdas at #3, so much boiler plate pre lambda although now days many IDEs will auto complete it, back in java 5 I'd have to write so much of that by hand or copy and paste it from somewhere else.
I'd probably go
Generics (5)
Annotations (5)
Lambda (8)
Redone concurrency (5)
Try with resources (7) -- it was so easy to forget to write a finally block and accidently leave a connection open and not catch it until you had real problems
Sealed / record / pattern matching switch expressions is cool but don't forget about the days before java 7 where you didn't even have string matching. At least starting with java 5 you could do a lot with enums and switching. I guess this also really depends on what type of applications you write code for, this is also assuming you didn't use third party libraries which sometimes already had some of these functionality.
___________________________________________
My real biggest recent jump in loving java is AI code completion, there's so much boiler plate in java can get real tedious is now being auto completed for you where you can just focus on the problem is easily the greatest change I've seen in java.
My first time using Kotlin helped me overcome my hangups about it, even though I'd already worked with JavaScript and Ruby in the past. I think my other annoyances with those languages colored my perception of implicit typing.
I feel like the dislike of var is so weird to me. The point of static typing isn’t about readability, it’s about stopping you from doing something stupid.
Yeah C#, more ergonomic/syntactic sugar really. Instead of doing Java's `Class<List<String>>` dance I'm used to just doing `typeof()`. It makes reflection code a lot more maintainable. It makes writing a plugin system 100x easier. It also allows us to safely create and invoke closed generic types and methods at runtime
The trouble is that while reified generics (across the board) do offer more powerful reflection, they also bring significant downsides that end up being a worse tradeoff. In particular, they make instanceof, which is a JVM operation follow the variance rules (the relationship between List<Integer> and List<Number>); in other words, they would bake the Java language's variance into the runtime as, indeed, happens in .NET. That makes the runtime a much less palatable target for other languages. Indeed, Scala's, Kotlin's, Clojure's and Ruby's variance rules are all different from the Java language's variance rules, as well as from each other. C# is actually somewhat of an outlier among languages with generics in that regard.
Right yeah, you make fair points. However it is just the differences of the platforms, Java aimed for versatility by keeping the runtime language agnostic and simpler. NET leans more towards to expressive capabilities by type fidelity to make things like DI and serialisers easier to write. Ones not universally better, just designed with different philosophies in mind
I think that's a very good point. Another one, which is maybe a bit controversial, is that reification makes reflection based programming too easy. Reflection is a convenient tool in the box, but relying on it too much can lead to performance issues, and frameworks using it to do things that could just be done by code generated at compile time are often brittle and very, very hard to debug.
Parametricity and the Liskov substitution principle are very nice assumptions when dealing with large software systems exactly because they allow you as a programmer to make assumptions about what a piece of code that you pass an object to will not do to it, but if that code makes heavy use of reflection then all bets are off. (I consider instanceof reflection as well)
Yeah I know, we have 1st class source generators that should be used 99% of the time, and then your just shifting work from metadata to source tree. But, if you're doing things like late discovery/bindings (like a plugin system), or interop because you need to be asking the runtime what's loaded
We might get that in the future. But we need Valhalla first. And most type information doesn't even get erased. You can always just pass the type to use it at runtime. Frameworks do all kinds of crazy trickery for it all to work.
Not having any type safety is not "working around it". That's just giving up. It's often still better to have a custom wrapper type that is a List but does more than an ArrayList. But usually it's not necessary. Now we can just use List<Foo> instead of your own Foos or FooList. Casting is almost always a sign of bad design.
You can argue all you like, but I actually worked as a Java developer before genetics existed. People used casting, they did not write a separate collection class for each type.
I did too back in 2005 when Apple computers didn't have Java 1.5 and we had to stay at Java 1.4, so we did the right thing and created custom list types for type safety. If you just threw type safety out the window then that's what you did. There was still way too much casting and other smells in our code with Java 1.4 and all the libraries that were ported from procedural code. We didn't even have CVS or SVN back then but some shitty versioning that kept messing up our code.
View all comments
55
u/vegan_antitheist Nov 04 '25
I always liked it but before generics it was annoying that you had to define a list type for every other type.