8 ms·
There has to be a more efficient way of writing cross-platform code than bundling Chrome and NodeJS with your app.
by bananaoomarang 10y ago
There has to be a more efficient way of writing cross-platform code than bundling Chrome and NodeJS with your app.
- mherrmann 10y agoThere is: I chose (Py)Qt for my desktop app https://fman.io https://fman.io for precisely this reason.
- mintplant 10y agoNote that unlike Qt itself, PyQt is only freely available under the GPL. Riverbank Computing also sells a commercial license. https://www.riverbankcomputing.com/commercial/license-faq https://www.riverbankcomputing.com/commercial/license-faq
- wyqydsyq 10y agoThere's plenty of cross-platform UI kits for a wide range of languages. The thing that's big about Electron is it allows web developers to use their existing skills to create desktop apps. A lot of web developers would like to make desktop apps, but aren't willing to learn a new systems language to do that, especially when there's a solution that lets them use the JS + HTML + CSS they already know.
- flukus 10y agoIf JS + HTML + CSS is all they know then I really don't want their software running on my machine.
- creshal 10y agoFor me, JS+HTML+CSS isn't (I had to outsource most of the UI code to our webdevs), but Qt or GTK (or, god forbid, Cocoa and whatever is Microsoft's newest fetish) are so much less productive that I just cannot justify writing in it any more. If you want a smooth UX with things like animated scene transitions (people scoff at animations, but if used sparingly and at the right places, they improve usability), or just any non-standard widgets, it's far, far easier to do everything in HTML. And the beauty of Electron is that you can still write all your actual logic in C/C++ and use Node's FFI to bind it to your UI. (Qt is transitioning to the same model with its HTML+JS based Qt Quick orchestrated from native code; but it's far less production ready than Electron right now.)
- flukus 10y agoMy comment wasn't so much about the quality of the tools (I'm currently learning react native), but the type of developer that only knows js. A developer that only knows js is unlikely to be competent (beginners aside).
- creshal 10y ago> A developer that only knows js is unlikely to be competent (beginners aside). Oh, don't get me started… Yes, that's a problem. But Electron can hardly be blamed for it. They'd use XULRunner if it didn't.
- krisdol 10y agoThe type of developer that only knows one language of any kind is in the same boat. Electron is popular because folks can write products at a faster pace than they could in other toolkits and languages. Being unproductive and fighting your tooling is not a sign of competency, nor is it a rite of passage. If folks can write apps faster in Java or Rust (which I love writing, by the way), I'm sure Electron would not have the adoption curve it does. Nothing to do with only knowing one language.
- wyqydsyq 10y agoI also know Python, Go and Rust, but I only use them for tinkering and experiments. I'd still use JS+CSS+HTML via Electron for a GUI app over traditional systems languages any day of the week.
- kozak 10y agoActually, not that plenty, if you consider only those that have good DPI scaling support and are cross-platform (at least between Windows and Mac).
- squeaky-clean 10y ago> The thing that's big about Electron is it allows web developers to use their existing skills to create desktop apps. Also it lets you reuse parts of your web app (or build part of your web app while building your desktop app). For something like Slack, or if Google were to make a desktop version of Docs, it makes a lot of sense to use Electron because you already have your web app and you want your desktop app to be consistent with it. I've used Ionic with a very small team to make a web app and mobile app from the same codebase. The client asked if we could also make a desktop version for them, and instead of taking months to build one and make it consistent with the web/mobile apps, it was just a few days of learning to wrap it up with Electron. That was really neat!
- creshal 10y agoLet me know it if you find one. Of all the cross-platform UI toolkits, only Qt is both stable and doesn't look like crap (sorry, WxWidgets)… and with Qt Quick it's also bundling Chrome, just binding it to C++ instead of NodeJS. It's really hard to beat HTML in terms of flexibility.
- yoz-y 10y agoQt does look like crap on OSX unless you reskin all of the widgets like QtCreator does.
- creshal 10y agoAFAIK Qt is still the least crap-looking cross-platform toolkit. GTK et al. are all even worse.
- Longhanks 10y agoEven Qt Creator sticks out. OS X/macOS users (disclaimer: like me) are really, really nit-picking when it comes to minor UI inconsistencies.
- yoz-y 10y agoYes it does (I use it on OSX every day). But maybe it is because it has grown on me, but I find it less distracting that other Qt applications that try to look like OSX.
- infinite8s 10y agoQt > 5.5 looks good on OS X, although some interactions are slightly off.
- open-source-ux 10y ago"There has to be a more efficient way of writing cross-platform code" Yes, it's called Freepascal using the Lazarus IDE. Native, cross-platform self-contained binaries that run fast and don't using oodles of memory or require massively-sized binaries. Why is it not more widely used? Because of that word Pascal. That's enough to dismiss it in the minds of many developers. Modern Pascal has many of the features we associate with modern languages e.g OOP and generics. But Pascal's syntax, age and verbosity mean many developers will never give it a second look.
- bbcbasic 10y agoDoes freepascal come with UI components? If not the same can be said about C C++ Haskell etc.
- derefr 10y agoWhat I'm really confused about is why Electron is set up such that each app ships the whole runtime, rather than there being something like the JRE or CLR (or Silverlight, or Adobe Air, or...) where each app that wants to use it, prompts for its installation. Better yet, why not make the architecture into a single shared "Electron windowing server" process that all Electron apps run "on", such that I don't end up running 7 different copies of Chrome? (Honestly, Chrome itself could have become said runtime with its packaged apps, plus the (only ever experimental) standalone App Launcher install mode. I guess that's not the path they wanted to go down.)
- scriptproof 10y agoIt seems to exist like a runtime (https://www.npmjs.com/package/electron https://www.npmjs.com/package/electron), but I have not tried it for now and I can't judge the usability in production.
- derefr 10y agoAn NPM package does not a runtime make. By "runtime", I'm referring to something that exists, at least, as an .msi on Windows and a .pkg on macOS, such that Electron can generate a "launcher wrapper" binary that will download and execute those in silent-install mode, then unpack and execute your app using the now-installed runtime.
- lawnchair_larry 10y agoBecause the node.js cult have lost their minds, only knowing how to bring the kitchen sink with everything they do, and only knowing javascript.
- Klathmon 10y agoIs this really necessary? It's a language/runtime, not a sports team. You throwing everyone that uses node.js into a big bin labeled "only knows javascript cult" is childish at best. There are obviously trade offs going with a "globally installed runtime" vs "including the runtime with each application". JRE takes the former, electron the latter. Each with their own set of problems, each providing different solutions, each with their own reasons, applications, and "target audience".