Live data from Hacker News

The decline and fall of Java on the desktop

jdeploy.substack.com

301–310 of 362 posts

Re: The decline and fall of Java on the desktop

#301
post #10

As a C# developer I remember the first time I developed a GUI java application. In C# you have a code-behind file with your own code and event handlers, and a "designer file" with the generated code to set-up the GUI itself. Then I used Netbeans for a Java app, and the code file contained weird sections of artificially not editable code, and event handlers were so much more complex and cumbersome - with inner classes…

While Java was designed to be multi-platform, C# was designed specifically to create software that could run only on Microsoft platforms. Any advantage provided by C# is negated by tying your work to a platform that could be abandoned by MS as they did to Visual Basic.

From the start C# was designed to run on any platform, which is why it compiled to IL and didn't use Win32 as the basis for the library.

It didn't take long for JIT compilers to exist for other platforms.

Re: The decline and fall of Java on the desktop

#302
post #204

Earlier quoted context omitted.

Well said! Java is the exact opposite of sane defaults: the programmer must explicitly choose defaults at every turn. Furthermore, it constantly feels like the arcane minutiae required in Java is Java-specific , in a way that other languages (C-based, functional) aren't. In Java, if I memorize an incantation, most of the information I've just learned is Java-specific. In C or C++, it's more computing specific. Other…

> In C or C++, it's more computing specific. Other languages will use different syntax, but I will be doing the same thing. I think you’ve just internalised C-isms. The core Java language is as close to conventional OOP as it gets, and the model is not that different from most OOP languages. It certainly isn’t alien . We ended up conflating C and computing, but it is more an accident of history and because so many la…

Java pass by reference vs pass by value vs C pass by reference vs pass by value?

Re: The decline and fall of Java on the desktop

#303
post #225

Earlier quoted context omitted.

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?

You build your Clojure app as an uberjar, yes. Only gotcha here is to remember "-Dcljfx.skip-javafx-initialization=true" so the JFX thread doesn't get started during build, and I've had no problems using Clojure's direct linking either. You use jlink[1] to create a custom runtime JRE image (this isn't strictly necessary if you're deploying to machines with a JRE but it cuts down on moving parts and gives you more control). jpackage[2] then takes that runtime image and your uberjar and creates installers for Mac/Windows/Linux. Both are command line tools, and we just have GitHub Actions that cut new releases for each platform when we tag something with a new version.

Worth also keeping an eye on jDeploy[3] which adds extra goodies like auto updates, at the cost of some npm shenanigans. Not something I've played with yet though.

1: https://docs.oracle.com/en/java/javase/17/docs/specs/man/jli...

2: https://docs.oracle.com/en/java/javase/17/docs/specs/man/jpa...

3: https://www.jdeploy.com/

Re: The decline and fall of Java on the desktop

#304

Earlier quoted context omitted.

I don't think so. In reality people don't care about native feel, they care about it looking good, working well and doing what they want.

Sure, the problem is - Java apps did neither. Looking good? The default Swing metal theme was truly awful. It was possible to switch to Windows-like theme, but it was even more awful - it had plenty of visual glitches and things misplaced by a few pixels it couldn't even use the native file selector window. Working well? Startup times and performance was terrible compared to native apps, and memory usage is still aby…

I didn't claim they did ...

Re: The decline and fall of Java on the desktop

#305
post #7
post #4

Java Swing still lets you make native-looking-and-feeling apps (with some care). I don't know of any new GUI frameworks that let you do the same. I consider this a killer-feature of the framework. It's also very fast, backed by OpenGL and DirectX. It also ships with source code and isn't declarative, so it's trivial to step into as a means to debug why your code isn't working.

I will freely admit that Java Swing remains the only GUI toolkit I've used that I actually felt comfortable using to write a GUI, rather than something that feels like having to pull out teeth to get things working in a somewhat coherent manner.

I don't do a lot of GUI programming, but I always found the Swing layouting to be very frustrating and counterintuitive.

As others have said, JavaFX is really pretty good. People who use JavaFX generally seem to be satisfied, it's not often I see a substantive criticism of it, but unfortunately it seems to be widely regarded as too little too late and doesn't get given a chance. The Ada of the GUI toolkit world.

Re: The decline and fall of Java on the desktop

#306
post #4

Java Swing still lets you make native-looking-and-feeling apps (with some care). I don't know of any new GUI frameworks that let you do the same. I consider this a killer-feature of the framework. It's also very fast, backed by OpenGL and DirectX. It also ships with source code and isn't declarative, so it's trivial to step into as a means to debug why your code isn't working.

> Java Swing still lets you make native-looking-and-feeling apps (with some care). I don't know of any new GUI frameworks that let you do the same.

That's the whole raison d'être of the (C++) wxWidgets toolkit. [0] It fully commits to using native GUI widgets, rather than impersonating them. (That is, it wraps various other toolkits.)

As others have pointed out, the other major cross-platform toolkits (Qt, GTK) also do a pretty good job.

[0] https://wxwidgets.org/

Re: The decline and fall of Java on the desktop

#307
post #251

Earlier quoted context omitted.

> And if there's any fault in the language chosen for AP computer science, the blame should go to the designer of the curriculum. Java was recommended for AP CS 22 years ago. At this point I lay less fault at their feet and I'm more interested in why it's still there at long last. > If by blockly you mean the visual interface, what you said is going to be true for any language. My research isn't published yet but I'v…

Write LOGO first, or scratch then. Java is a good intermediate step as a first serious programming language - it has good compile time messages, and even more importantly, it has pretty much full runtime safety, which is absent from python, c, javascript et alia. With these languages students will struggle with code that seem to work, yet are faulty - it is better to fail with an “ugly” but readable exceptions during…

> Also, java is a tiny language, I really don’t get your point. Sure, hello world requires 3 lines of boilerplate, but other than that you have pretty much listed every single java feature there is. How many languages’ feature list can you enumerate in a rant?

I wasn't enumerating all of the features of the language, but by saying so you basically proved my point. I was enumerating all of the features of the language present in the very first "Hello World" program. It's not about 3 lines, it's about the density of over a dozen concepts packed into those three lines. That's what people mean when they say to do anything in Java you have to know everything about Java.

> Write LOGO first, or scratch then.

Logo and scratch are great first languages, and they spark joy and imagination in children. Then they move to Java and it sucks the inspiration right out of them. Honestly I think students, teachers, and everyone except Java shops would be better off if students started with Logo turtle graphics in elementary school and used it throughout middle and high school as the capable Lisp that it is. Yes we won't graduate as many object oriented Java programmers, but... well I guess there is no but, I really can't see the downside in what I just said.

Re: The decline and fall of Java on the desktop

#308

As a member of the Swing/JavaFX/Netbeans teams during the 2005-2010 period (I left the day before Oracle took over), I can tell you that this story is broadly correct, but with many missing subtleties. At the time we thought of Silverlight and Flash and Adobe Air as our mortal enemies. We were all wrong. After AJAX and HTML Canvas the web essentially killed desktop app development. All of those internal corporate app…

Yet it's 2022 and I literally don't use web-based desktop apps for my day-to-day work ? Likewise, the SteamDeck just released with a desktop UI built entirely in Qt? I feel we are living in alternate realities

How does your statement contradict anything? What you use is entirely anecdotical, and the Deck is a niche gaming platform. Except for niche usages like utilities and the creative industry, classical desktop apps are dead for both consumer and enterprise users.

Re: The decline and fall of Java on the desktop

#310

Java's only claim to fame is that's the granddaddy of C#, a far superior language and IMHO one of the greatest computer languages ever created. In addition, Java was ahead of its time, with mid-1990's computing power not up to the job of letting it run smoothly on lower and mid-tier PC's. It also required, for that time, an egregious amount of RAM memory.

C# is Java done right.

Nothing special really, it shines only when compared to other mediocre scripting language we use nowadays.

Performance wise it's still on the heavy side.

As a user I hate both Java e C# desktop app.

Post reply on HN