Live data from Hacker News

Java 12

jdk.java.net

181–190 of 478 posts

Re: Java 12

#181
post #32

Earlier quoted context omitted.

Serious question: Isn't Java still one of the default languages if you are choosing a "safe" language to build and maintain a large piece of software? Considering how long it's been around and how many libraries exist for it now, i've generally viewed it as a language that's: - fast enough for most things without a lot of pitfalls/gotchas - easy enough to read for most developers - easy enough for most developers to…

All of those points are also true for C#, which imho fixes a lot of Java's problems and is a much nicer language. With .Net Core maturing you even get the "runs everywhere" factor (at least everywhere you care about, i.e. Win+Linux+Mac), and Microsoft is a much better vendor than Oracle.

The problem with C#, which I think is a fine language, is the small(ish) size of the ecosystem and the refusal of the ecosystem to deviate away from non-MS endorsed libraries and frameworks.

It's the ridiculously large JVM ecosystem that makes Java awesome, not the language.

Re: Java 12

#182

Earlier quoted context omitted.

> But it's extremely fast compared to anything but Go, C#, and "low level" languages nobody wants to touch for web stuff. Fast is a poor word to talk about benchmarks between languages. Memory, throughput, latency are the things we should be talking about. There’s also trade offs where predictable scaling of latency under massive load is important (Erlang, Elxir), or spending less memory and starting up quickly in or…

> OO in general is not fine. I smell a zealot or a troll.

Please elaborate on how OO is fine. OO hides state, which makes reasoning about cache, and therefore performance very difficult, which is why most game programers take a data oriented approach. It hides state but gains none of the advantages of Erlang because all of the implementations forgot to make state only mutable through explicit message passing. Inheritance isn’t an abstraction because you inherit both code and state, which requires explicit knowledge of the intervals of the parent. It’s a code pasting tool. As OO tries to model arbitrary patterns in nature it’s also difficult to reason about the graph of objects apposed to the linear flow of data in FP. Pretty much all of the OO languages are walking back OO features at this point and trying to add type classes (contracts) or functional pieces, mapping and filtering a la linear data transformations.

Re: Java 12

#183

I understand why Java has to keep on chugging along, but I feel bad for the people that have to be a part of it. It's like watching people keep coal trains going while people are moving to cars. Why? Besides being owned by Oracle, which is enough of a reason to never use Java ever again, it's also lost the niches that brought it into existence. Java no longer runs everywhere. Java on the web is dead, and you can now…

The Java Platform is state-of-the-art in compilation technology, GC, and monitoring/management; nothing else comes close on almost any one of those, and certainly not on all of them combined. The alternatives you mentioned are all "good enough" for some use cases, but are technologically years behind the JVM. Some people are fine driving a Hyundai, but others want to drive a Ferrari. Besides, if you need to write some serious software that has to be performant and manageable and that you're going to need to depend on for years and years, there really aren't that many alternatives. That's why Amazon and Netflix and Google and Apple and Twitter choose Java to run all/most/many of their backend. Such large companies tend to use Java more on new projects as they grow (that's the case with Facebook and GitHub).

It is true that for smaller, less demanding software, there are many alternatives, but except for a very short period (~2000-2005) Java never dominated that kind of software. Early on people used VB, FoxPro and Delphi for that stuff, and later PHP, Python and Node.

Re: Java 12

#184

Earlier quoted context omitted.

> it's also lost the niches that brought it into existence Applets, JavaBeans, and CORBA. What a loss. > Besides being owned by Oracle, which is enough of a reason to never use Java ever again, That stopped being an issue years ago. OpenJDK is a thing, you know? > Java on the web is dead, I don't think you have any idea about the hundreds of millions of lines of Java that power the web as you know it today. The rest…

>>> That stopped being an issue years ago. OpenJDK is a thing, you know? Well, that's seeing the glass half full. OpenJDK was complete garbage in the java 6-7 era, less than 5 years ago. Pretty much every major java software was requiring to install the Oracle JDK. Nobody would accept a bug or a support issue if it happened with the OpenJDK, which was the first question to be asked. And that wasn't fear mongering, ja…

Yeah this was a problem for 6 & 7, but I've run plenty of code in production on OpenJDK 8 without issue. I think Java 8 was the first version where OpenJDK was the reference implementation so that likely helped a great deal.

Re: Java 12

#185

Earlier quoted context omitted.

I'm not sure if you're trolling so I'll try to keep this short. Java is old, it's crufty. Yes. But it's extremely fast compared to anything but Go, C#, and "low level" languages nobody wants to touch for web stuff. The JVM is also extremely reliable. I've seen apps run for years straight. And the tooling is better than basically anything. Profiling, debugging, realtime code generation and modification. Libraries for…

> But it's extremely fast compared to anything but Go, C#, and "low level" languages nobody wants to touch for web stuff. Fast is a poor word to talk about benchmarks between languages. Memory, throughput, latency are the things we should be talking about. There’s also trade offs where predictable scaling of latency under massive load is important (Erlang, Elxir), or spending less memory and starting up quickly in or…

Not only do you have to figure out what’s going on in the JVM you also need to duplicate your effort to figure out how the JVM is running on the host.

Isn't that true for all other languages you mentioned? python, erlang, php, golang bundles a runtime, etc..

Re: Java 12

#186
Switch expressions prepare the way for pattern matching (https://openjdk.java.net/jeps/305), instead of `instanceof` checks and casts.

But (in my naive opinion) double dispatch seems a more elegant and java-ry solution, i.e. polymorphism on argument classes, so different methods are invoked for different object runtime classes (instead of using the compiletime type of the variable).

The switching could be optimised, as ordinary polymorphism is in the JVM.

Sure, you'd wreck legacy code if you just introduced it, but there's surely a backcompatible way to do it that isn't too awkward.

BONUS: goodbye visitor pattern!

Re: Java 12

#187

I understand why Java has to keep on chugging along, but I feel bad for the people that have to be a part of it. It's like watching people keep coal trains going while people are moving to cars. Why? Besides being owned by Oracle, which is enough of a reason to never use Java ever again, it's also lost the niches that brought it into existence. Java no longer runs everywhere. Java on the web is dead, and you can now…

> it's also lost the niches that brought it into existence Applets, JavaBeans, and CORBA. What a loss. > Besides being owned by Oracle, which is enough of a reason to never use Java ever again, That stopped being an issue years ago. OpenJDK is a thing, you know? > Java on the web is dead, I don't think you have any idea about the hundreds of millions of lines of Java that power the web as you know it today. The rest…

That stopped being an issue years ago. OpenJDK is a thing, you know?

If Oracle's ridiculous interpretation of API copyrights holds up, they have a kill switch for OpenJDK.

Re: Java 12

#188
post #132

Meanwhile, most enterprise apps still seem to only work with JRE 8. And those which I know of have elected to replace Java rather than upgrade.

We have quite a couple of them running happily with Java 11.

Were there any hiccups in the upgrade?

Re: Java 12

#189

Earlier quoted context omitted.

I'm not sure if you're trolling so I'll try to keep this short. Java is old, it's crufty. Yes. But it's extremely fast compared to anything but Go, C#, and "low level" languages nobody wants to touch for web stuff. The JVM is also extremely reliable. I've seen apps run for years straight. And the tooling is better than basically anything. Profiling, debugging, realtime code generation and modification. Libraries for…

> But it's extremely fast compared to anything but Go, C#, and "low level" languages nobody wants to touch for web stuff. Fast is a poor word to talk about benchmarks between languages. Memory, throughput, latency are the things we should be talking about. There’s also trade offs where predictable scaling of latency under massive load is important (Erlang, Elxir), or spending less memory and starting up quickly in or…

Java would take the cake in almost anything speed measure you mentioned. Golang is the only one comparable in memory throughput and latency. Java with async IO like Vert.X can do higher concurrency than Erlang. As can Go.

IMO Java is the most well rounded language, but I'm not trying to convince you of that.

Also there's nothing with java that stops threads from being restarted. In a modern web framework it's virtually impossible to crash the JVM. You just crash a thread, at most (usually the framework catches the exception and it doesn't even do that). Java is also hot reloadable if you use the right framework.

Your tooling argument doesn't make much sense IMO. You can attach to a Go binary but that's about it. Attaching to a VM or interpreter will tell you almost nothing. I would wager you haven't used a Java profile if you're making these arguments. It's vastly superior to anything but maybe C#

Re: Java 12

#190

Earlier quoted context omitted.

> But it's extremely fast compared to anything but Go, C#, and "low level" languages nobody wants to touch for web stuff. Fast is a poor word to talk about benchmarks between languages. Memory, throughput, latency are the things we should be talking about. There’s also trade offs where predictable scaling of latency under massive load is important (Erlang, Elxir), or spending less memory and starting up quickly in or…

Not only do you have to figure out what’s going on in the JVM you also need to duplicate your effort to figure out how the JVM is running on the host. Isn't that true for all other languages you mentioned? python, erlang, php, golang bundles a runtime, etc..

It’s a spectrum. Java is at the very end with Erlang. I have a lot of domain specific knowledge of The Beam. Go on the other hand has a very lightweight runtime.
Post reply on HN