6 ms·
We must have a “new features since Java 8” post every other day.
by irl_chad 5y ago
We must have a “new features since Java 8” post every other day.
- pjmlp 5y agoBecause plenty of people judge Java by their pre-Java 8 frozen knowledge. At least it isn't yet another link to re-written in Rust headlines.
- junon 5y agoI must be in the minority of thinking java 7 was the last great version of Java. What I see today is a nearly different language.
- vbezhenar 5y agoI liked Java 1.4. Generics were a mess. And Java before generics was so wonderfully simple. Yes, you had to cast, but that wasn’t a big issue. My favourite language would be Java 1.4 with carefully redesigned standard library (because old standard library was not very nice).
- pharmakom 5y agoIsn’t that almost Go? Well, before Go generics land.
- unscaled 5y agoYeah, I miss the good and simple times when Java didn't have all this unnecessary bloat like generics and annotations. We generously peppered our code with casts from Object and explicit boxing and unboxing, and it was good. Our code was so clean and readable, and we neatly wired everything together by configuring class names in XML. We were happy and life was good. </sarcasm> In all seriousness, Java's implementation of generics was less than ideal, but I recently had to deal with a lot of pre-Java 1.5 codebases that haven't seen much upgrade in recent years. It wasn't fun.
- Consultant32452 5y agoHonestly, I don't see anyone using any of the new features. Oddly enough I do get asked about them in interviews.
- johnisgood 5y agoThis just makes me hate interviews even more. Why ask questions that are supposed to be looked up anyway, or once used, are known? I mean, certainly if you saw a new feature being used in a codebase at that workplace then you would be able to use it, too. I probably would not be able to answer it with regarding to Kotlin, for example, but I would certainly be able to notice (or at the very least look it up), understand, and use. Would it make me fail the interview?
- shepherdjerred 5y agoI use the new language features all of the time. Variable type conferencing with the var keyword is incredible. The new Java 11 module system allows me to write code more safely without accidentally crossing levels of abstraction. Java 17's text blocks are a really nice enhancement. Pattern matching with switch statements makes code a little more concise, and reduces the chance of forgetting to update switch statements when a new value to an enum is added. Record classes add immutable-by-default data structures which make packages like Lombok less necessary. Pattern matching with instanceof reduces verbosity and makes code feel a little more modern -- it feels more similar to writing Swift or Rust. I've used all of these features. They're all great.