Live data from Hacker News

What's new in Java 12, 13 and 14

java.christmas

31–40 of 136 posts

Re: What's new in Java 12, 13 and 14

#31
post #22

As someone that used to write a lot of C#, I find that the language is changing so often that it's hard to know what's new and what's been around for years. In contrast, Java hasn't changed all that much over the years, and I wonder if an approach of taking the more useful features from C# and ignoring some of the others would be a good approach. I often wonder how Java developers feel when they look over at C#, and…

It's not taking some features and ignoring others. It's taking features than have shown good cost/benefit, and not taking those that haven't. The choice here is about which features not to adopt, just as much as it is about which features to adopt. Java's philosophy is still innovation in the VM while keeping the language conservative. It's just that conservative is a relative term, here. If some language feature seems to have a good cost/benefit ratio and it's become mainstream enough, Java will adopt it.

BTW, Java has also "exploded in functionality over the last decade", it just hasn't translated to language changes. Even the project I work on, adding lightweight concurrency, will not change the language at all, while in C# it took the form of a huge language change (async/await). Nevertheless, in Java the added functionality will be at least the same as it's been in .NET.

Re: What's new in Java 12, 13 and 14

#32
Sigh, I know new language features are cool, but I highly doubt the growing dominance of Python and JS is a question primarily of language features. Python has a REPL and the outstanding tooling built on that along with an ecosystem of libraries where a default use case is the design choice. That all leads to "fast" development which what a lot of people care about. JS has the default use app deployment area: browser.

Meanwhile Java's REPL is a pretty sad imitation, and I see no movement toward trying to get back in the user app space.

I love the JVM and the language itself is good enough, but the management of Java features through the years leaves me disappointed.

* I know Android is Java and Kotlin focused but Android development is entirely different than writing a JavaSE app. Also know Kotlin compiles to JS, and I think that supports my grumpy young man persona. A hugely successful language IDE company saw it useful to build a cross compiling language on your platform.

Re: What's new in Java 12, 13 and 14

#33

The new style of switch statements is very nice. I've found myself using if else blocks to replace switch statements because they're simply more legible, and they take up less vertical space. Now the new style switch statements will be an improvement over that.

Its copied from Scala pattern matching, and still isn't as good as it.

It's not copied from Scala, there were many languages before Scala which had this feature before.

Re: What's new in Java 12, 13 and 14

#34
post #27
post #13

Earlier quoted context omitted.

Java moved to a six-months release cycle in 2017: https://en.wikipedia.org/wiki/Java_version_history Java 8 had its end-of-life for commercial usage in january 2019. The new long term release is Java 11. Time to move on for you.

>Java 8 had its end-of-life for commercial usage in january 2019 _Oracle's_ Java 8 end-of-lifed, but many other vendors provide TLS for their respective Java implementations.

Just a correction: they are not separate implementations. Almost all vendors use Oracle's Java implementation -- OpenJDK. It's just that only Oracle and companies that license the source from Oracle (like Azul) can release non-GPL builds based on OpenJDK, so other vendors maintain old OpenJDK versions by doing their own backporting from the mainline, where most of the work is done by Oracle.

Re: What's new in Java 12, 13 and 14

#35
post #5

Pattern matching in switch statements (calling them match statements would then be more fitting), a nice way to deal with nulls, and proper sum types (aka tagged unions, like enums in Rust) and Java would be pretty up-to-date.

You still get the ancient and quirky generic programming, barely a support.

Re: What's new in Java 12, 13 and 14

#37
post #31
post #22

As someone that used to write a lot of C#, I find that the language is changing so often that it's hard to know what's new and what's been around for years. In contrast, Java hasn't changed all that much over the years, and I wonder if an approach of taking the more useful features from C# and ignoring some of the others would be a good approach. I often wonder how Java developers feel when they look over at C#, and…

It's not taking some features and ignoring others. It's taking features than have shown good cost/benefit, and not taking those that haven't. The choice here is about which features not to adopt, just as much as it is about which features to adopt. Java's philosophy is still innovation in the VM while keeping the language conservative. It's just that conservative is a relative term, here. If some language feature see…

[deleted]

Re: What's new in Java 12, 13 and 14

#38
post #32

Sigh, I know new language features are cool, but I highly doubt the growing dominance of Python and JS is a question primarily of language features. Python has a REPL and the outstanding tooling built on that along with an ecosystem of libraries where a default use case is the design choice. That all leads to "fast" development which what a lot of people care about. JS has the default use app deployment area: browser…

Right, but will We Assembly be a JS killer?

If I can stay in Python and target the browser without the fuss and bother of JavaScript, why would I?

Re: What's new in Java 12, 13 and 14

#40
post #32

Sigh, I know new language features are cool, but I highly doubt the growing dominance of Python and JS is a question primarily of language features. Python has a REPL and the outstanding tooling built on that along with an ecosystem of libraries where a default use case is the design choice. That all leads to "fast" development which what a lot of people care about. JS has the default use app deployment area: browser…

Right, but will We Assembly be a JS killer? If I can stay in Python and target the browser without the fuss and bother of JavaScript, why would I?

You might not, but JS is popular enough for many developers to continue using it.
Post reply on HN