News for hackers. Stuff that matters.
Re:Electron 6.0 by polote on Wednesday July 31, 2019 @06:00AM (#20572937)
Every time I hear about Electron, I have mixed feeling about it, is it :

* one the best thing that happened to desktop software as it enable web developers to build desktop portable app

* one of the worst thing that happened, because it makes the desktop world rely on Google and decrease even more the expectations on how much resources an app should consume

What are your opinions ?

Re:Electron 6.0 by kgraves on Wednesday July 31, 2019 @06:10AM (#20572986)
The latter, I have a 3GB laptop. Almost any application I use that is electron makes my laptop scream for help (fan spinning furiously) and freezes it up.

I have to kill the application before it consumes everything.

Electron applications like VS Code are an exception and slightly gives me hope.

Re:Electron 6.0 by stevewodil on Wednesday July 31, 2019 @10:06AM (#20574507)
Does anyone know what makes VS Code an exception to this?

Going to be working on an Electron app, so I'm curious about what optimizations have been made there.

Re:Electron 6.0 by kitsunesoba on Wednesday July 31, 2019 @01:18PM (#20576282)
It’s likely just sheer difference in quality of engineering. For most companies that choose Electron, performance was never of any value in the first place and that’s reflected in the engineering regardless of how/what it’s written in. It just happens that bad code is much more egregiously bad with JS/Electron than with other stacks.
Re:Electron 6.0 by 52-6F-62 on Wednesday July 31, 2019 @10:48AM (#20574819)
I can't speak to VSCode, but I've been probably a hard use case for Electron development as I work in an industry without a ton of resources to throw at development, limited time, and less supportive environment for development (in spite of a pressing need to keep up).

I've found keeping as precious little of the work in the render process as possible has helped a great deal. Send everything to the main process and use the event/messaging system to update the state. Then things that you're used to doing to maintain application performance in a web browser apply. Keep the compute in the back as much as possible.

And depending on the task, offload compute to a native module [if you're capable and] if the expense between NodeJS <> native module is worth it (more intense compute tasks).

There's probably more and more experienced advice out there, but this is my experience so far.

Re:Electron 6.0 by jayjader on Wednesday July 31, 2019 @10:54AM (#20574853)
If I recall correctly, VS Code bundles its own Electron that Microsoft's team has spent considerable time & effort optimizing for it.
Re:Electron 6.0 by armandososa on Wednesday July 31, 2019 @12:07PM (#20575544)
Re:Electron 6.0 by mdgrech23 on Wednesday July 31, 2019 @11:07AM (#20574978)
Pretty sure they forked electron. Not sure what they did to it. Also they probably drop down to native for a lot of tasks.
Re:Electron 6.0 by Matthias247 on Wednesday July 31, 2019 @01:24PM (#20576345)
No. They are even contributing to upstream Electron - and they did this before Github was acquired by Microsoft.

They just run more efficient software on top of electron than others do.

Re:Electron 6.0 by rimliu on Wednesday July 31, 2019 @06:06AM (#20572971)
Imagine if desktop developer wanted to go into web development. I assume he would learn HTML, CSS, JS. Why cannot web developers wanting to create desktop app learn new languages and SDKs? I've spent many years as a web developer, and a bit fewer years as iOS developer. Now I am back with web again, but I still thing way too much of the recent trends are being optimized for the developers at the cost of users.
Re:Electron 6.0 by yboris on Wednesday July 31, 2019 @07:06AM (#20573295)
Thanks to Electron I was able to build an app for Win, Mac, & Linux. Had there not been electron, my app would be only for Windows and no one else.

I strongly suspect I'd never be able to bring the level of polish I could with HTML & CSS to the UI through the standard SDKs -- so the resulting app would be a much worse user experience as well.

The amount of time I'd have to spend learning a new SDK would basically put me off, and I'd likely never have created this app.

Instead I have over 700 people who have purchased my app (~2 purchases per day over the past half year) - https://videohubapp.com/

Re:Electron 6.0 by bbmario on Wednesday July 31, 2019 @08:03AM (#20573622)
Never be able? C'mon, your app is basically one of the Qt samples dude.
Re:Electron 6.0 by yboris on Wednesday July 31, 2019 @08:32AM (#20573857)
Sorry for using "never" -- certainly I could spend a lot more time learning the tricks that could get me close.

But UI is not essential for a functioning app, and if the time costs of building a good UI are too high (a lot of new learning and problem solving) I'll spend less time on it.

What "sample" are you talking about? Is this the kind of thing you're comparing my app to? https://doc.qt.io/qt-5/examples-graphicsview.html

Re:Electron 6.0 by f00zz on Wednesday July 31, 2019 @09:53AM (#20574414)
That's a Qt Widget example, you should look at Qt Quick for a way to build more modern-looking interfaces. With Qt Quick user interfaces are described in QML, a declarative markup language, and you can write most (or all, if you want) the business logic in Javascript. See for instance:

https://doc.qt.io/qt-5/qtdoc-demos-photoviewer-example.html

(Edit: by no means I'm saying that your work is trivial to replicate, apologies if this comment came across like that - just wanted to point out that there's more to Qt than Qt Widget.)

Re:Electron 6.0 by yboris on Wednesday July 31, 2019 @11:26AM (#20575161)
Thank you for the direct link. Over the years I've glanced at Qt, I've been discouraged by the amount of work I'd need to do to accomplish even trivial things that I can with HTML.

The original reply I made was to point out that startup costs decrease number of people starting. Unless you know Qt already, your first project will take much longer than using technologies you already know. It's not at all clear how long learning would take.

I know I can climb the mountain, but I'd rather not. This isn't to discourage others from doing it, it's to explain to those who don't understand why many people prefer to stick to Electron.

Re:Electron 6.0 by jcelerier on Wednesday July 31, 2019 @09:50AM (#20574394)
I think he's referring to this sample (https://doc.qt.io/qt-5/qtdoc-demos-photoviewer-example.html) - replace Image by VideoPlayer, tweak the ui, make some menus, add a few interactions and you're good to go from what is visible on your screenshots - were I still a freelancer I would maybe have quoted two weeks for that ?
Re:Electron 6.0 by hombre_fatal on Wednesday July 31, 2019 @10:18AM (#20574603)
They're dismissing your work as trivial because there's a sample that does the first 1% of what it takes to build, polish, sell, and support an app that people actually use. Same kind of person who thinks all the projects that died in their ~/Code folder are "almost done".
Re:Electron 6.0 by mbel on Wednesday July 31, 2019 @10:31AM (#20574686)
More likely this one: https://doc.qt.io/qt-5/qtmultimedia-multimedia-video-qmlvide...

Simple QML viedo player.

Re:Electron 6.0 by gridlockd on Wednesday July 31, 2019 @06:50AM (#20573193)
The main thing that Electron does is solve most of the platform abstraction issues. The only contender that comes close to this is Qt.

However, if you want to hire Qt developers, that's a much smaller pool and then you also need to pay Qt license fees for each one.

If you want to develop truly native applications, now you need to maintain builds for Windows, Mac OS and perhaps even Linux. You need developers familiar with all of these native frameworks.

Optimizing for developers isn't necessarily worse for users, if they can get more done in less time, users benefit. It's just not so obvious. No user will ever complain about a product they aren't using because it won't ship until next year with half the features.

Re:Electron 6.0 by lpcvoid on Wednesday July 31, 2019 @09:17AM (#20574168)
There's also Lazarus/Freepascal [1], which has platform support and GUI capabilities for pretty much every CPU/Platform under the sun.

[1] https://www.lazarus-ide.org/

Re:Electron 6.0 by de_watcher on Wednesday July 31, 2019 @07:27AM (#20573415)
You don't need to pay Qt license fees if you don't do secret modifications to the Qt library itself.
Re:Electron 6.0 by gridlockd on Wednesday July 31, 2019 @08:18AM (#20573759)
This is not the only issue with LGPL code, but fair enough: commercial development is possible without paying for the license.
Re:Electron 6.0 by solarkraft on Wednesday July 31, 2019 @07:35AM (#20573463)
Are you sure you don't need to pay about 5k€/seat/year for commercial development?
Re:Electron 6.0 by bdemirkir on Wednesday July 31, 2019 @07:52AM (#20573562)
You don't need to pay at all. Comparison is here: https://www.qt.io/download

Basically, you need to link dynamically or provide object files. You can't use commercial modules too. But that's only a small portion of Qt anyway.

Re:Electron 6.0 by dx87 on Wednesday July 31, 2019 @07:53AM (#20573571)
Yep, paying just gets you extra Qt features and allows you to make the whole application closed source. The community version requires you to keep the Qt portion of the application under the LGPL, but you can still keep the rest of your application closed source and just link agains the Qt code.
Re:Electron 6.0 by zazaraka on Wednesday July 31, 2019 @08:53AM (#20573990)
Microsoft has a zillion native SDK developers. Recently they replaced their native Visual Studio installer with an Electron based one.

That should tell you something.

Re:Electron 6.0 by lawnchair_larry on Wednesday July 31, 2019 @10:49AM (#20574824)
That isn’t how big companies work. The decision about what to use is up to the 5 or so developers working on an app. Microsoft doesn’t force specific languages or frameworks across all of their devs, and the native SDK devs are working on their own projects.
Re:Electron 6.0 by AnIdiotOnTheNet on Wednesday July 31, 2019 @10:22AM (#20574627)
Based on other things MS is doing, it tells me they're hiring a lot of young developers who only know web tech and don't give a damn about the user experience.
Re:Electron 6.0 by JustSomeNobody on Wednesday July 31, 2019 @09:49AM (#20574385)
It sure does. It says MS is still pushing bloat.
Re:Electron 6.0 by cztomsik on Friday August 02, 2019 @12:06PM (#20594092)
Web & JavaScript is really great platform for quick prototyping and when you're doing UIs, it's all about being able to iterate fast.

It might change a bit with Flutter & SwiftUI but I still find web & CSS to be a better authoring model.

Note that I've been doing (native) desktop programming before so I can compare.

Re:Electron 6.0 by chuckhendo on Wednesday July 31, 2019 @09:04AM (#20574073)
You understand that many Electron projects are FOSS, right? I understand what you're saying about optimizing for development rather than users, but if Electron didn't exist many of these projects wouldn't exist. If you see a project that you feel would be better as a native app, why don't you build it and release it as FOSS?
Re:Electron 6.0 by crispinb on Wednesday July 31, 2019 @06:07AM (#20572974)
Haven't we had enough opinions on Electron, for and against, to last several average lifetimes?
Re:Electron 6.0 by hombre_fatal on Wednesday July 31, 2019 @10:15AM (#20574584)
@dang should start stickying his comment with links to every previous Electron release submission for people who want to replay all the belabored arguments (dismissals) again and again.
Re:Electron 6.0 by megous on Wednesday July 31, 2019 @12:06PM (#20575539)
It's great tool for personal use, to write quick single purpose UIs in webtech that can access DB directly, without the need to write the backend or much with REST APIs.

For personal use, you also don't need multiple runtimes for multiple electron apps. You can just use the single shared one (or even system one; for example archlinux has electron installable via pacman), reducing memory use.

It's also pretty good tool to write your own UI for other people's websites.

Re:Electron 6.0 by canada_dry on Wednesday July 31, 2019 @04:31PM (#20578190)
> own UI for other people's websites ... // ... single purpose UIs in webtech that can access DB directly

Can you point to some good examples of these use cases?

Re:Electron 6.0 by megous on Wednesday July 31, 2019 @07:35PM (#20579762)
I use pg-promise for DB and UI is a bunch of vanilla JS.

You can get data with XMLHttpRequest inside electron from any origin and then just process the returned document with regular web apis.

Sorry, I don't have anything public.

Re:Electron 6.0 by pjmlp on Wednesday July 31, 2019 @06:30AM (#20573083)
That Electron fad will eventually die as HTA and XUL did before it.

With my Web developer hat, I see the future as PWAs and if you really need more than Web APIs allow, by all means create a local daemon that uses whatever browser the user has installed.

All my uses of Electron are forced upon me, if native versions are available and I am allowed to choose, native wins.

Re:Electron 6.0 by CodesInChaos on Wednesday July 31, 2019 @07:49AM (#20573543)
PWA is the opposite of what I want. I want signed packages/manifests with well defined content (plus binary transparency). Not each application shipping its own downloader code which caches an ill defined set of files locally.