Live data from Hacker News

The decline and fall of Java on the desktop

jdeploy.substack.com

281–290 of 362 posts

Re: The decline and fall of Java on the desktop

#281

Earlier quoted context omitted.

> Luckily there seems to be a push for fully native. Really? I thought there was a push for Electron/Chromium everywhere (which seems comparable or worse than desktop Java...)

I think Electron is neither here nor there. It is the "stroad" of software distribution: the sluggishness and poor performance of a web interface, coupled with the difficulty to upgrade of a desktop package. Personally I push for either native apps or web apps, to regain at least one of the benefits lost by packaging web apps.

> coupled with the difficulty to upgrade of a desktop package

Huh? Two Electron apps that I use are Github Desktop and VSC. Neither is sluggish and both have streamlined automatic updates.

Re: The decline and fall of Java on the desktop

#282
post #275

Earlier quoted context omitted.

C++ ides do cache files and monitor for changes too but they are much more useable on low-end hardware than anything Java.

Citation and meaningful comparative ananlysis needed here. I would want to be certain you are not making a comparison with powerful text editors like Slickedit or Emacs - these are not the same. At the scale that something like IntelliJ or your favourite C++ based IDE operate at, Java is not the bottleneck. It’s all down to the system complexity involved in doing all that code crunching in near real time and the inte…

I'm mainly using Qt Creator, which has integrated on-the-fly code analysis with clangd for instance and I guess most of what you'd expect from a modern IDE, many refactorings, various unit test system integrations, SSH support...

When trying CLion on the exact same projects everything is just so much slower with no major value-add, like, even opening UI menus feels sluggish. And let's not even talk about typing text, I feel like I'm fighting my keyboard whenever I try to use it. (My computer is an Intel 6900k with 64 GB of RAM to give a point of reference)

Re: The decline and fall of Java on the desktop

#283
post #153

Earlier quoted context omitted.

The exception doesn’t prove the rule. It’s ridiculous that I have to modify Java VM arguments so IntelliJ can use more ram and actually index my projects. The IDE is great, but Java undoubtedly makes it worse.

That’s the fault of jetbrains, not java. They release it with way too old JRE with custom patches and quite shitty default arguments, while it works eons better with no argument at all on an up-to-date jdk, but even more so with the single setting of a low-latency GC, ZGC. The JVM is a beast, why do you think a good deal of all serious web applications run on top of it?

> The JVM is a beast, why do you think a good deal of all serious web applications run on top of it?

When I run a Java app-server I'm happy to, in fact it's unwise not to, allocate it the maximum possible RAM the underlying server has. That's because I know for sure JVM is the only thing that's going to be running on a server.

On a desktop it's a totally different story. IntelliJ has to compete with other applications for RAM because I'm constantly multi-tasking between browser tabs, Apple Music, Slack app and what not. So allocating RAM to JVM apps on desktop is a world of pain because I, as a desktop user, just don't (want to) know how to fine-tune hardware resources for different apps. I don't allocate heap to Safari, why should it be the case with IntelliJ? Why can't they figure out? Or maybe there should be a desktop version/mode of JVM that'll figure out ideal RAM size and work with it and expand/shrink as needed?

Re: The decline and fall of Java on the desktop

#284

Java on desktop in 2022 seems like a lost cause. It's always slow and hogs resources like crazy. A good example is all the Jetbrains IDE's. Try running any of them on a low powered laptop and you end up having a bad time. Luckily there seems to be a push for fully native.

Is slowness of intelliJ IDEs attributable to Java alone? Android studio feels more sluggish than vanilla IntelliJ.

I had to write an app in JavaFX for a course project. Compared to most desktop apps written using electron, it was fine. But by default it looks like an old desktop app, for which you'd expect some more performance. It maybe still good for enterprise apps where you have some Java programmers.

Also, startup time; It had some noticeable delay.

I tried flutter recently; If you ignore that apps look like mobile apps, flutter desktop apps feel more responsive.

As for paradigm, recent UI-in-code frameworks like flutter seem superior. In JavaFX you can write Widgets in code or in FXML, but java the language or APIs don't fit into that paradigm like Flutter does.

Re: The decline and fall of Java on the desktop

#285
post #225
post #176

Earlier quoted context omitted.

In Clojure you can use JavaFX through cljfx https://github.com/cljfx/cljfx/ I haven't used React, but I think it's very similar. You have a state atom and then a datastructure that represents the GUI and associated callbacks that modify the atom. So it ends up feeling very functional. It doesn't use hiccup, but it's a similar structure. I've got to say it was fantastic. The least painful GUI programming I've ever don…

I’ve found cljfx very productive. Steep learning curve, and the abstractions are somewhat leaky, but it’s worth the pain around the edges for the core workflow. Wrapping controls like ControlsFX is trivial. We’ve written a wrapper for TestFX as well so we have full functional tests and everything gets built, tested, jlinked and jpackaged continuously. It’s been one of the least painful projects I’ve ever worked on tb…

Do you have any good resources on how to use jlink/ jpackage with Clojure? Do you somehow embed it in a Uberjar or is the Uberjar part of the package besides the JRE?

Re: The decline and fall of Java on the desktop

#286

Earlier quoted context omitted.

> but the amount of needless bashing it gets here is astonishing I don't think it's needless. I'll bash Java as long as it's the language for AP computer science. Imagine a budding young programmer, bright eyed and bushy tailed, eager to get into computer science. They get to class and greet the teacher "Welcome class, let's learn about Java. There's a wide world of computers out there, but your perception of computi…

We switched to Python at my school. Not sure how I feel about Python (or Java) as a first language. Something a bit lower like C would be a better foundation, IMO.

Python is definitely simpler to start with but it doesn't expose the beginners to some concepts directly - interfaces are implicit because of duck typing (unless you use the ABC module), everything is public (underscores are just a convention), there is no method overloading etc.

I think it might be more valuable to expose beginners to static typing because it's much easier to transition from "objects have distinct types" to "pretty much everything is just a hashmap" than the other way around.

The thing about C as a first language is that you need to not only learn what programming is but you also need to learn manual memory management which raises the bar significantly and it's pretty easy to write code that fails for reasons which are difficult for a beginner to figure out (like segfaults).

Re: The decline and fall of Java on the desktop

#287
post #33

IMO the real decline was Oracle. Java used to be a slowly rising language and set of platforms with benevolent oversight from SUN and at least the outlook that it was one of a few things you might want to add after Microsoft's Windows or Apple's OS (Macintosh or later OSX). Then Oracle bought SUN and everyone knew all of the good would eventually be strangled out by the lawyers and models that sought to dominate and…

Oracle certainly wasn't good for Java. But Java-on-the-desktop had been struggling for years before that. You either bundled a complete JVM with your application (fine if you're making a 500MB IDE, not so good for anything smaller) or you had the embarrassment of directing your users to an installer that bundled the Ask toolbar. They might even end up with the security-hole-riddled java browser plugin. And even once…

...or you had the embarrassment of directing your users to an installer that bundled the Ask toolbar

....the Ask toolbar. Had happily forgotten about that.

shudder

Re: The decline and fall of Java on the desktop

#288
Maybe the story is not finished yet. New approaches like JetBrain's Compose (https://www.jetbrains.com/de-de/lp/compose-mpp/) with a React inspired programming model might bring some new interest to the platform. Then there is a Java binding library for Skia (https://github.com/JetBrains/skija), and JavaFX is also alive and high quality.

As everyone is used to fat Electron apps now, Java applications (especially compiled and packed with new JDK features) might be refreshing.

Re: The decline and fall of Java on the desktop

#289
A little off topic -> I was reading the comments about learning to code through Java. A lot of people are against C/C++ and majority of schools uses Java/Python nowdays.

Ofc the language at the end doesn't really matters, but I am conviced ( mostly because I only embrace MY learning experience ) that using a language like C helps you get into the programming mindset better.

I mean, you don't need to understand what a smart pointer is, but once you seen that the object you have created in your own implementation of a vector got copied over and over, you will think twice every time you write a function with a return statement in every language for the rest of your life.

Re: The decline and fall of Java on the desktop

#290
post #54

Earlier quoted context omitted.

Basically, every growth figure of the language shows otherwise. Oracle is ain’t saints, but the amount of needless bashing it gets here is astonishing. Regardless of what its other branches are doing, Oracle managed to do one of the smoothest language takeovers where the (stellar) core team is virtually unchanged, the language became completely open sourced and it underwent tremendous changes which resulted in huge g…

> but the amount of needless bashing it gets here is astonishing I don't think it's needless. I'll bash Java as long as it's the language for AP computer science. Imagine a budding young programmer, bright eyed and bushy tailed, eager to get into computer science. They get to class and greet the teacher "Welcome class, let's learn about Java. There's a wide world of computers out there, but your perception of computi…

> "I thought programming was all Java!"

If students get this preconception, I think it's more an issue how they are taught, not an issue with Java itself. I mean the first language I learned and most of my classes were in Java, but that didn't prevent me from knowing there other existing languages and learning about them.

Post reply on HN