News for hackers. Stuff that matters.
Re:Java Feature Spotlight: Text Blocks by pron on Friday May 01, 2020 @10:39AM (#23042400)
That's like a compulsive hoarder seeing a guy buying a lawn chair and saying, oh, nice to see you finally catching up!

That the Java language is slow to evolve while the Java platform evolves quickly has been one of the central strategies of Java since inception. In fact, James Gosling wrote back in 1997 how Java should only adopt language features loooong after they've been tried in other languages. It's worked very, very well. There's obviously a portion of users (<10%) who prefer a faster-moving, feature-rich language, and they have good options on the Java platform, but the Java language philosophy has been more attractive to a much larger group of developers.

What is more interesting is not which features Java has chosen to adopt, but which ones it hasn't and won't: yes to lightweight threads but no to async/await; yes to pattern-matching but no to extension methods.

Re:Java Feature Spotlight: Text Blocks by nickbauman on Saturday May 02, 2020 @07:18PM (#23055643)
What you're saying is exactly what I'm saying, except we disagree what a "better language" is. I find the approach Java has taken causes people to fetishize complexity with it. It's not so much about "my language has more features than Java therefore it's better" (the hoarder reference) it's "my language is simpler than Java therefore it achieves what Java does with less in multiple dimensions." And I don't mean Scala, either. That's just piling on more of what Java is.
Re:Java Feature Spotlight: Text Blocks by dehrmann on Friday May 01, 2020 @12:33PM (#23043777)
> compulsive hoarder

I'm looking at Scala and C++

Re:Java Feature Spotlight: Text Blocks by Something1234 on Friday May 01, 2020 @11:49AM (#23043252)
Can you list some of the interesting features that were not adopted in Java?
Re:Java Feature Spotlight: Text Blocks by pron on Saturday May 02, 2020 @04:14AM (#23050255)
Features that Java doesn't and won't have:

Extension methods

Async/await -- Java is going with lightweight threads.

Re:Java Feature Spotlight: Text Blocks by renewiltord on Friday May 01, 2020 @09:14PM (#23048191)
* Lambda syntax took years after it was mainstream.

* I don't think Java still has string interpolation.

* List, Map literals are not a thing Java has either.

* Value types aren't in yet.

* If as expressions. You have to use ternary.

These aren't complaints. I know what I'm getting with Java. No hate.

Re:Java Feature Spotlight: Text Blocks by vips7L on Friday May 01, 2020 @09:46PM (#23048362)
What's wrong with List.of(1,2,3) or Map.of("a", 1, "b", 2)?

Switch expressions can do what if expressions do.

Re:Java Feature Spotlight: Text Blocks by renewiltord on Friday May 01, 2020 @09:53PM (#23048397)
Nothing's wrong with that or with `String.format`. I just find it less ergonomic. Like I said, no complaints anywhere. You can just as well use `ExecutorService`s instead of async/await and all that.