Live data from Hacker News

Say no to Electron: use JavaFX to write a fast, responsive desktop app

sites.google.com

41–50 of 143 posts

Re: Say no to Electron: use JavaFX to write a fast, responsive desktop app

#41

"you can distribute it to any user on any OS and it will just work." I had to check the date on this article to see if it was from 2007 or something. Under no circumstances does java "just work", its an insane mess of java shipped with the os, being updated, and people not updating due to oracle trying to force feed crapware as part of their installers/updaters. I, for one, do not live in a world that resembles anyth…

Generally java desktop software is wrapped together with a bundled jre and behaves like an executable without external dependencies. There are a bunch of ways to do this. For example: https://github.com/libgdx/packr

Re: Say no to Electron: use JavaFX to write a fast, responsive desktop app

#42

> This is not as much a result of the superiority of the web stack for building applications (far from that, I don't think anyone disagrees that the web is a mess), as a failure of the current desktop UI frameworks. If people are preferring to ship a full web browser with their apps just so they can use great tools such as JavaScript (sarcasm) to build them, something must have gone terribly wrong. This article so th…

[deleted]

Re: Say no to Electron: use JavaFX to write a fast, responsive desktop app

#43

> This is not as much a result of the superiority of the web stack for building applications (far from that, I don't think anyone disagrees that the web is a mess), as a failure of the current desktop UI frameworks. If people are preferring to ship a full web browser with their apps just so they can use great tools such as JavaScript (sarcasm) to build them, something must have gone terribly wrong. This article so th…

... wow. Yes. I don't understand how the author has missed that the web is good and JS and CSS and HTML are a fantastic set of technologies for building applications. They work.

I don't write frontend / GUIs for a living (I tend to do C and Python). But I have done work with GTK+ and Qt, and I have done work with Angular and other random JS frameworks, and the web is so good.

All the complaining about the web is from people who just want it to be better.

Re: Say no to Electron: use JavaFX to write a fast, responsive desktop app

#44

Don't say no to Electron just yet. And if you do, jesus, there's better alternatives than JavaFX (use Qt). You know what Electron has brought us? It's brought the Linux desktop reliable feature parity with other platforms. Fat chance Visual Studio Code (often hailed as "one of the best-optimized electron apps") would have existed on Linux without Electron. Discord, another fantastic Electron app, is functionally iden…

I would argue that it doesn't give desktop developers "access to the web's fantastic tooling and iteration speed," as the tooling and iteration speed for the web is crap compared to desktop. "Hot Reload" is kind of a poor substitute, as I still need to edit text that correlates with what I'm seeing instead of interacting with it directly. I can get something working in C++/Qt, PyQt5, WinForms/C#/.Net (windows) way faster†.

However, it does let people hit 4 platforms way quicker than even two, which is a huge deal. And while I'm working out the kinks in my Qt app, the Javascript dev has a version anyone with a browser can use on anything right away, even if the desktop version isn't ready yet.

†Pouring one out for HyperCard. I miss that wonderland.

Edit: Damn you auto-markdown.

Re: Say no to Electron: use JavaFX to write a fast, responsive desktop app

#45
post #2

> That's a world of difference from an Electron app, which typically needs 200MB just to open. This is sort of an unfair comparison - the JavaFX one is mainly smaller because it doesn't include the distribution of Java and all the libraries, which is if I recall correctly about 200 MB, while Electron commonly includes all libraries and the renderer. I will give you that the Java distribution can at least be shared by…

Java 9 adds jlink, which lets you create a runtime image containing only the java modules you're using.

This means you can ship a considerably smaller built in JRE with your app, if you don't want to depend on a system JRE.

javapackager (uses jlink): https://docs.oracle.com/javase/9/deploy/self-contained-appli...

jlink: https://docs.oracle.com/javase/9/tools/jlink.htm

Re: Say no to Electron: use JavaFX to write a fast, responsive desktop app

#46
post #2

> That's a world of difference from an Electron app, which typically needs 200MB just to open. This is sort of an unfair comparison - the JavaFX one is mainly smaller because it doesn't include the distribution of Java and all the libraries, which is if I recall correctly about 200 MB, while Electron commonly includes all libraries and the renderer. I will give you that the Java distribution can at least be shared by…

The install size on disk is indeed about 200 mb including the Java runtime. However the claim here is that Electron uses 200mb of RAM, which is much more precious than disk

Most of the Java runtime is not actually used by most apps so the new modular Java 9 should produce much smaller installs, but I haven't tried it yet.

Re: Say no to Electron: use JavaFX to write a fast, responsive desktop app

#47
post #6

As much as I dislike the inherent complexity of Electron, VSCode and Discord are existence proofs that it can be used effectively. VSCode is far faster than any other IDE I've used, and even beats VIM in terminal in terms of responsiveness (altough I suspect this is not VIM's fault). Discord is overall a great application, and quite responsive. Both are slightly bloated in terms of memory, from what I supect they cou…

One thing that can make vim in a terminal feel slow is related to the escape character doing double duty to signal extra information to terminal applications (e.g. arrow keys or window size) on the same channel as regular input.

To catch a single press of the escape key, vim needs to wait a little bit to make sure it's not the start of an escape sequence. Sometimes that delay is configured too generous and becomes noticeable, especially when chaining applications (like running vim in tmux).

Re: Say no to Electron: use JavaFX to write a fast, responsive desktop app

#48

"you can distribute it to any user on any OS and it will just work." I had to check the date on this article to see if it was from 2007 or something. Under no circumstances does java "just work", its an insane mess of java shipped with the os, being updated, and people not updating due to oracle trying to force feed crapware as part of their installers/updaters. I, for one, do not live in a world that resembles anyth…

Javafx includes a packager tool which creates a native application with the runtime bundled inside. There is nothing to install.

.NET could use that.

Re: Say no to Electron: use JavaFX to write a fast, responsive desktop app

#49

Yeah, you just have to have Java installed on whatever system you're running the app on. From a development perspective (or anyone who has done end-user support of a desktop app) this is an absolute non-starter. "Install this runtime, then you can install this app. Oh and that auto updater that is atrocious? You can thank us for having it. Thanks for being a loyal customer!"

Have you never installed an app that required the Dot Net runtime to be installed?

Re: Say no to Electron: use JavaFX to write a fast, responsive desktop app

#50
How did this get upvoted? Author misses the point entirely of Electron. If people wanted to write Java, they already would be doing that. The selling point for Electron is: folks are comfortable with JavaScript/HTML/CSS and can be productive right away. I'll take the neatly packaged (although larger) installer over requiring someone to have the JDK installed any day
Post reply on HN