Live data from Hacker News

What's new in Java 12, 13 and 14

java.christmas

51–60 of 136 posts

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

#51
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…

What do you really get out of a Java or Python REPL?

If it’s the simple kind like python in bash, it’s really primitive compared to an IDE where you can inspect things. Why doesn’t a simple project suffice?

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

#52
post #48

Is it me or does the below sound condescending? Trying new features is a good way to broaden your skill set, and if there is something you strongly dislike about the usability of a feature you can even provide feedback to the JDK developers. To me it reads like: Try our experimental features because that will make you a better (rounded | paid) developer, and if you really really want you may even provide feedback.

No offense, but that's probably you. Even if I try to read that as condescending, I have a hard time doing it. I read that as: trying new stuff in code generally makes you a better programmer. And when you test stuff that's still in an experimental phase, the language designers are probably still open to feedback from the broader public.

None taken! I'm getting allergic to corpo talk lately and it looks like I'm overreacting!

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

#54

Cached: https://web.archive.org/web/20191217093210/https://java.chri... (Google hasn't cached it yet as of this writing)

Curios, why post this?

Because I tried to access the page a few times over a two-hour period, and it always timed out.

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

#55
post #20
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.

Oooh that's a good idea. Does that already exist in other languages? I've not seen it before.

[deleted]

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

#56
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.

I'm still not sure why imperative/OOP language have been so resistant to adding pattern-matching of the sort seen in Haskell and OCaml.

There are plenty of almost entirely pointless features that get implemented in major languages, like 'events' in C#. They add almost no value to the programmer. Pattern-matching would be really useful for avoiding rats' nests of control-flow, but until recently no major imperative language even seemed to consider adding them.

The extremely obscure Felix programming language has had pattern matching for years. [0] As nestorD says, Rust has them now, as does Kotlin. About time.

[0] http://felix-lang.github.io/felix/

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

#57

Will we ever get to see golang-style multiple return values/results?

Method chaining becomes complicated if you have multiple return values. In Go, you can't return error values if you want to do method chaining. Error handling then becomes even more complicated.

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

#58
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.

I'm still not sure why imperative/OOP language have been so resistant to adding pattern-matching of the sort seen in Haskell and OCaml. There are plenty of almost entirely pointless features that get implemented in major languages, like 'events' in C#. They add almost no value to the programmer. Pattern-matching would be really useful for avoiding rats' nests of control-flow, but until recently no major imperative la…

Erlang is where I first encountered pattern matching, and it's so integral to the language it simply would cease to exist without it.

I was pleasantly surprised when I discovered Python 2 would pattern match tuples in function parameters...and then very disappointed when I discovered a few weeks later that Python 3 had removed even that minimal amount of syntactic sugar.

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

#59
post #51
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…

What do you really get out of a Java or Python REPL? If it’s the simple kind like python in bash, it’s really primitive compared to an IDE where you can inspect things. Why doesn’t a simple project suffice?

> What do you really get out of a Java or Python REPL?

For my part, a REPL helps me think about what I'm doing. There's a design process prior to writing code--sketch things out on paper, do a mind map, assemble pieces, get a general architecture. In the thick of coding, though, it's nice to be able to try out an idea or two in real time, test as you go, and feel out how the code is taking shape.

REPLs are really an invaluable tool for thinking about code in real time. For some people that may not be helpful or necessary, but it's expedient for me.

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

#60

Will we ever get to see golang-style multiple return values/results?

Method chaining becomes complicated if you have multiple return values. In Go, you can't return error values if you want to do method chaining. Error handling then becomes even more complicated.

I would like to have the result type for this, like in Rust:

enum Result { Ok(T), Err(E), }

Post reply on HN