Hacker News new | ask | show | jobs
by tanx16 878 days ago
In defense of the companies that do this - making native apps is extremely expensive compared to just using Electron. If you want to have a native app for Mac and Windows and a website, that's 3 separate frontends that you have to propagate changes across. This triples all the work that you typically have to do (UX changes, platform-specific bugfixes, etc), and getting some fullstack developers are cheaper than hiring Mac/Windows specialists.

I think HN users are in the minority of users who seriously care about speed/performance. Electron is good enough for pretty much everyone else, and it's clearly working well for for Discord and Slack. It makes more sense IMO to invest time in improving Electron efficiency rather than telling companies to just avoid it.

2 comments

Avalonia https://avaloniaui.net/ QML https://doc.qt.io/qt-6/qmlapplications.html and other options exist. The choice is not between Electron or native. There's lots of options in between "everything native from scratch" and "ship the whole browser".

Also for many electron apps you're going to write a native component too.

By the point you are using QML I don't think it's actually that much lighter than Electron. QtWidgets is probably justifiably better in this regard. Not all electron apps have to be as bloated as Slack, for example. It's possible to design sane applications.
No, it's still not the same category. QML doesn't pull in a full featured Chrome with all its runtimes, dom, full scripting, multiple levels of JIT, etc. You're still significantly lighter. Even Avalonia with bundled .net is lighter.
QML is very efficient. Much of custom QML code ones write actually compiles to C++[1]. All the code of Qt Quick components are written in C++ as well. I'm now creating a block editor in Qt C++ (model) and QML (view) that is 4x faster than that fastest comparable native app on macOS[2]. So, yes, it's possible to write very efficient code with QML.

[1] https://www.qt.io/blog/qml-type-compilation

[2] https://www.get-plume.com/

For paid software at least, it would be a silly strategy.

The point of buying software on the Mac is that it is tailored for the specific environment. Someone who doesn't care about any of that wouldn't even be a potential customer, since they wouldn't even use Macs often enough to consider buying anything.

At most it would only be attracting customers who are forced to buy that software because there are no alternatives.