Live data from Hacker News

Java 16

jdk.java.net

211–220 of 327 posts

Re: Java 16

#211
Do you think the "Run anywhere" marketing behind Java is rarely important?

Java programs normally sit on a server, or many servers of the same arch.

The decent thing is that someone can build a JVM for a new architecture and lots of /other/ languages that target the JVM work.

But this seems different from "my program can runs on lots of architectures".

Re: Java 16

#212

Do you think the "Run anywhere" marketing behind Java is rarely important? Java programs normally sit on a server, or many servers of the same arch. The decent thing is that someone can build a JVM for a new architecture and lots of /other/ languages that target the JVM work. But this seems different from "my program can runs on lots of architectures".

In the 1990s it looked very much as if desktop and server heterogeneity would be the norm. That you'd pick between alternatives like Solaris on SPARC, HP-UX on PA-RISC, Irix on MIPS, Windows on Alpha / MIPS / x86 / PowerPC, MacOS on PowerPC, OS/2 on PowerPC / x86 etc etc.

The designers of Java, as well as software community at large, had dealt with the pain of moving large codebases across platforms and so the WORA promise was very appealing.

Re: Java 16

#213

Earlier quoted context omitted.

> C++ is more portable because it doesn't require the JVM to run Java is portable BECAUSE of the JVM. If a new computer architecture hits the scene, once someone writes a JVM for it your .class files will run on it (probably). Your C++ program, however, will definitely not run and you'll need to recompile it with a compiler that targets that new architecture. The same compiled Java code will(should) run on a Mac or a…

For a couple decades, x86 was absolutely dominant and there were no new architectures of any importance outside specific niches. Once you dealt with the OS specific oddities (which java also helped with), C++ was highly portable.

> For a couple decades, x86 was absolutely dominant

On the desktop and servers, maybe. But there is more in heaven and embedded than is dreamt of in your philosophy.

Re: Java 16

#214
post #192

Earlier quoted context omitted.

When people call .class files portable, they mean between platforms that have a JVM available and can pass the TCK. Platforms that do not aim to do that are not really relevant.

That's like saying C++ exe's are portable if you just ignore all platforms that don't have an NT kernel. Market share determines a platform's relevance to portability claims, not its intention towards the JVM.

I see that your goalposts in this discussion are also highly portable.

Re: Java 16

#215

Earlier quoted context omitted.

When you build Android you're not building it on Android, you're building it on Windows, MacOS, or Linux. Maven itself is not being run on Android or iOS. The Java code that powers Maven isn't portable. The AndroidX code hosted on Maven that everyone is pulling down for Android isn't portable, either. Your claim would be like saying that PHP is portable because every platform has a web browser that can talk to the se…

Who cares about Maven-the-app, we are talking about the portability of the JVM bytecode. There are gigs of JVM bytecodes stored on Maven Central and these bytecodes are being downloaded and run on macOS, Windows, Linux, and Android on a daily basis without a single change. The very same libraries. Unchanged. That's the very definition of portability. I don't understand why you keep shifting topics by bringing up irre…

There's no portability requirement to being on Maven Central. Maven Central regularly hosts non-portable bytecode - like every AndroidX library.

And, again, none of those libraries run on Windows, Android, iOS, and web - the 4 major platforms by market share. At best you get half of those, but typically you don't even get that, and that's still only libraries. None of them are portable applications.

It's trivial to write semi-portable C++ snippets, too, that's not a major achievement.

Re: Java 16

#216
post #162

Earlier quoted context omitted.

There is an nginx in front of it. What was wrong with Apache?

The "event loop" model in Nginx beat Apache performance wise.

Apache has since added support for the event-based model: https://httpd.apache.org/docs/2.4/mod/event.html

Re: Java 16

#217

Lots of shiny new toys to play with :) I like playing with new features and pushing to silly limits. Here's some fun things you can do now: Compiletime checked state machines with Sealed Classes [preview feature] https://benjiweber.co.uk/blog/2020/10/03/sealed-java-state-m... Autobuilders, Mixins, Conversions & more with Records https://benjiweber.co.uk/blog/2020/09/19/fun-with-java-recor... Pattern Matching fun http…

If you enjoy pattern matching in Java, I would recommend checking out the latest & greatest that C# has to offer as a comparison: https://docs.microsoft.com/en-us/dotnet/csharp/pattern-match... Being able to combine pattern matching with switch expressions has allowed us to construct extraordinarily concise state machines for our UIs.

Or just use Scala and stay on JVM. You can even easily mix Scala and Java classes within the project.

Re: Java 16

#218

As a student most of the way through a Java course, I'm wondering what Java is still used for. Java applets are dead, Android is moving on to Kotlin (apparently Google got in legal trouble with Oracle even though Java is "open source?"), and I can't think of any desktop applications that use Java anymore. Java is supposed to be able to "run anywhere," yet C++ is more portable because it doesn't require the JVM to run…

Java is rarely used for sexy stuff like front-ends or (increasingly) apps. Java is, however, used for services. Bank logins, search engines (Google originally used it), insurance systems. C#, C++ and Rust are in the same area. But Java, for the most case, has been around longer. A LOT of companies used it and can't easily switch their codebase to something newer and shinier. And now Java improves with every release t…

> A LOT of companies used it and can't easily switch their codebase to something newer and shinier

I don't agree with that. Spring Boot makes it so easy to write nice backends and a type system is often useful

> they have fewer reasons to move

Move to what btw? NodeJS?

Re: Java 16

#219

As a student most of the way through a Java course, I'm wondering what Java is still used for. Java applets are dead, Android is moving on to Kotlin (apparently Google got in legal trouble with Oracle even though Java is "open source?"), and I can't think of any desktop applications that use Java anymore. Java is supposed to be able to "run anywhere," yet C++ is more portable because it doesn't require the JVM to run…

Literally every business that adopted it back in the 90s. Like all of insurance.

Re: Java 16

#220
post #124

As a student most of the way through a Java course, I'm wondering what Java is still used for. Java applets are dead, Android is moving on to Kotlin (apparently Google got in legal trouble with Oracle even though Java is "open source?"), and I can't think of any desktop applications that use Java anymore. Java is supposed to be able to "run anywhere," yet C++ is more portable because it doesn't require the JVM to run…

> and I can't think of any desktop applications that use Java anymore. The desktop application everyone has to use to report the income tax in my country is written in Java. Which is nice since it runs anywhere that has a recent enough JRE; in a distant past, before it was rewritten in Java, it was first a DOS-only and then a Windows-only desktop application.

All jetbrains IDEs are JAVA. Webstorm, Intellij etc
Post reply on HN