4 ms·
then why is java adding back half baked versions of scala features every major release
by dionian 9mo ago
then why is java adding back half baked versions of scala features every major release
- morshu9001 9mo agoCause it actually needed lambdas and things that go with it. Didn't need all the Scala-specific data structs like Array. And the most important thing Java was always missing until recently, virtual threads, were lacking in Scala too.
- kelnos 9mo agoVirtual threads is a JVM & stdlib feature, not a language feature. (And I'd disagree that virtual threads were all that important compared to language features.)
- morshu9001 9mo agoIn pretty common applications, virtual threads will make the difference between chaining futures (this.then(that).then(...)) vs not, all throughout your code. Or some frameworks had far uglier ways to deal with cooperative multitasking.
- EricRiese 9mo agoLambdas weren't simple to shoehorn into Java. But most of the recent changes have been implemented as well or better, or as well as you could imagine while maintaining backwards compatibility and Java-ness. Records/sealed interfaces (ADTs) are quite clean. Text Blocks are better in Java IMO. The margin junk in Scala is silly.
- brabel 9mo agoSaying that the new Java features are half baked, to me, shows you're just feeling hurt because people prefer Java over your favourite language. Java may not be the pinnacle of programming languages, but since Java 8, pretty much every feature it's added has been absolutely excellently done.
- dionian 9mo agoi mean, it follows the java philosophy (preseving backward compat). theyve done great work improving java. but i see no reason to use it over scala where i get better features, its more like a java 2.0
- surgical_fire 9mo agoThen don't. You can use Scala to your heart's content. No one is stopping you. I had to work on a Scala codebase at some point, and I thought it horrible. I judge a language on how easy it allows you to create an unreadable mess. Scala makes it incredibly easy. And the people that enjoy Scala seem to like "unreadable messiness" as a feature. I found it fun to learn the basics, and it was interesting to think of problems from a FP approach, but it is never something I would use in the real world. I vastly prefer Java. The features it imported from Scala were fine, made the language better. It doesn't need to import everything.
- morshu9001 9mo agoUsually someone is stopping you, unless this is a hobby project. At least Scala can use Java libs so you aren't stopped by stuff not being available for it. But yeah I would never use it.