Live data from Hacker News

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

sites.google.com

51–60 of 143 posts

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

#51

"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…

It does just work, at least compared to web apps. I have experience of both web dev and distributing a somewhat complex JavaFX app to consumers. I bundled the JRE with my app so the users did not need to have Java installed.

The leaks in the operating system abstraction Java gives you are really quite small. I wrote my entire app on macOS and tested on Linux/Windows only right at the end - after about 8 months of full time dev work I spent about a day addressing platform specific issues. That's pretty good.

Now compare that to the mess that web browsers were and still are. It's better than it once was, but you're going to have to check every single feature of HTML5 you use to figure out which browsers implement it, which don't, which use vendor prefixes still, which only half implement it, which don't but can be shimmed using big blobs of JavaScript and so on. The web absolutely doesn't "just work": you will spend more far time working around browser specific issues than you will spend dealing with OS specific issues in Java.

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

#52
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…

> even beats VIM in terminal in terms of responsiveness

For real?

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

#53
post #40

Earlier quoted context omitted.

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

Once the runtime is bundled in, what does the size of the standalone application come in at? Curious if it is close that of a bare Electron app (around 50-90 MB, depending on the platform).

For Java 8 it is about 200mb. Java 9 should be smaller because it should only bundle the parts the app actually used.

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

#54
post #14

This article seems to miss the point. There's a huge pool of web developers who can write HTML/CSS/JavaScript; Electron lets you have those people use their skills to build desktop apps. It also lets all the others not directly working on the product to write plugins using familiar technology.

Yeah you get your front end devs creating beautiful UIs which can be directly ported to desktop.

The other thing of course is that Electron apps start out as web applications. So they already work perfectly in a browser.

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

#55
Ugh this just reads like an old Java developer pissed off at people not using his tool of choice. His snide remark about JavaScript just tells me that he has an outdated view of the language. JS is weird yes. JS has problems yes. But the author is promoting friggin JAVA as the alternative?? Phfft!

There are reasons to pick your tools. Sometimes speed of development and being able to use your pool of developers existing skill sets effectively is one of them. If you have a bunch of web developers and need a desktop app then electron is something you might want to seriously consider. ESPECIALLY if you don't have unlimited time to get the product out to market. Electron is not a one size fits all choice and conversely neither are the frameworks the author is proposing. Decide what you need and make your choice based upon those needs.

I am building an electron app as we speak. Its not without its challenges and there is no doubt that native approaches would trump it in some respects but it literally does everything I need it to do. Better yet, I can hand this off to my team who all have a development background and any one of them can jump in and be able to contribute in a meaningful manner within a day or two of groking the codebase.

I guess my point is, lets stop bagging on technologies for the sake of it. Every single one of them involves trade offs. Effective developers weigh those against the problem they are trying to solve and pull the trigger on the one that gets the job done best.

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

#56
post #40

Earlier quoted context omitted.

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

Once the runtime is bundled in, what does the size of the standalone application come in at? Curious if it is close that of a bare Electron app (around 50-90 MB, depending on the platform).

In my project, the jar file itself is 20MB, and the resulting files generated by javapackager are: 55MB (.exe), 90MB (.dmg), and 67MB (.deb), all of which include the jar file inside them. These are not the total file size after installation, though.

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

#57

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…

Huh? JavaFX works great on Linux.

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

#59

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…

> And if you do, jesus, there's better alternatives than JavaFX (use Qt).

Because "god forbid" anyone use technologies associated with java? FUD at its finest.

> Fat chance Visual Studio Code (often hailed as "one of the best-optimized electron apps") would have existed on Linux without Electron.

I just use IntelliJ IDEA. It's ten times faster and ten times more powerful than Visual Studio Code. And it's written with java swing.

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

#60

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…

As someone who has written desktop JavaFX apps and web apps, I don't think you know what you're talking about. I can tell because you talked about the web's "fantastic tooling and iteration speed". That's a bit of a giveaway - I'm willing to bet you've never written a JavaFX app in your life.

JavaFX apps work just fine on Linux. Not even fine, they work well. I know because I've written them and tested them on Linux. And not just trivial toy apps: the app I wrote was a full blown peer to peer app with an integrated Bitcoin wallet, a Twitter Bootstrap themed UI, file associations, visual effects like animated Gaussian blurs and an integrated auto-update framework.

There's nothing magic about Electron. It's just another desktop app toolkit. There's no good reason to use it except developer familiarity with HTML. It gives you all the disadvantages of desktop distribution (you have to provide your own auto update framework, get users to download the app) but with none of the advantages like great tooling, great languages, UI builders and so on.

Post reply on HN