News for hackers. Stuff that matters.
Re:The iOS and Mac markets are almost the same size? by Wowfunhappy on Friday March 27, 2020 @08:21PM (#22708100)
> Plus the experience of Electron apps is generally superior lately

Uh, I'm going to hard disagree on that. They take longer to open, they're slower to use, they take up more battery, and they don't behave in a consistent way with the rest of the OS.

Re:The iOS and Mac markets are almost the same size? by _bxg1 on Saturday March 28, 2020 @12:36AM (#22709238)
In my experience, purely from a UX perspective (both visuals and responsiveness), a hand-crafted macOS app tends to be moderately better than an Electron app, but an Electron app is usually vastly better than a shoddy or cross-compiled native app.
Re:The iOS and Mac markets are almost the same size? by leadingthenet on Saturday March 28, 2020 @05:12AM (#22710074)
A well-crafted, organic, gluten-free macOS app is generally the best UI and UX experience on any platform, by a mile. Apps that come to mind are Things by Cultured Code and (the as of yet unreleased to the public) Nova editor by Panic.

No Electron app has ever even come close for me, certainly not VSCode that everyone seems to love so much.

Then there's performance...

Re:The iOS and Mac markets are almost the same size? by _bxg1 on Saturday March 28, 2020 @11:49AM (#22711823)
Agree with the first part.

But I would say the Slack UX, from a visual and performance perspective (not necessarily intuitiveness), is as good as nearly any native Mac app I've ever used. VSCode, from a visual and performance perspective, is better than any native Windows app I've ever used, and also as good as many native Mac apps.

I know people like to gripe about the memory usage and disk space usage of Electron apps, which, fine. But it's a fairly academic complaint. Those things don't honestly affect my experience as a user. The only time an Electron app has ever felt sluggish to me was Atom, fully loaded with plugins (~3 years ago), and I honestly suspect that had more to do with its naive and non-cooperative plugin architecture than with Electron itself.

Re:The iOS and Mac markets are almost the same size? by Wowfunhappy on Saturday March 28, 2020 @03:13PM (#22713571)
> I know people like to gripe about the memory usage and disk space usage of Electron apps, which, fine. But it's a fairly academic complaint.

Whether it's academic depends entirely on how much memory you have, and what else is using that memory. As with most resource-intensive software, you can brute force it with raw specs, but you're left with less computing power than you paid for.

I was watching The Verge's review of the new Macbook Air last night, and they were talking about battery life. I'm paraphrasing, but they said something like: "Apple claims 13 hours of battery life, and you can get that if you live in Safari and other Apple apps. But I'm living my life in Chrome and Slack, and with those apps open I get closer to five hours."

Chrome and Slack are, of course, the same thing.

As strongly as I dislike locked down platforms, situations like this do make me somewhat understand why Apple doesn't allow web rendering engines other than Safari on iOS.

Re:The iOS and Mac markets are almost the same size? by _bxg1 on Saturday March 28, 2020 @04:32PM (#22714109)
The weight of Chrome as a browser and the more general concept of using the web as a desktop app platform are two different things. I think that when most people complain about "electron apps", what they're complaining about is the latter. If you're complaining about the former, I think that's more fair. Although, I do question whether a third-party browser even has access to the APIs that make Safari's efficiency what it is.

What I'd like to see, personally, is for the three major desktop OSes to agree on a "desktop WebView" standard. Then they can use whatever browser internals they want when it comes to launching those web apps. They could even let you pick your own, the same way you can pick your default browser now. This would not only allow people to use desktop safari for their "electron apps" if they want to, it would avoid one of today's major problems which is shipping a whole copy of the browser with each app. Web-based desktop apps would be no larger than native ones, and depending on how the OS handles them they could be roughly as performant.

Re:The iOS and Mac markets are almost the same size? by Wowfunhappy on Saturday March 28, 2020 @05:22PM (#22714424)
> The weight of Chrome as a browser and the more general concept of using the web as a desktop app platform are two different things.

I understand where you're coming from, but when someone says says "Electron apps are slow resource hogs", they're fundamentally referring to the underlying engine that makes those apps slow. If that engine was fast and light on resources, the complaint wouldn't exist.

Apple _does_ allow developers to use Safari Webviews within desktop apps, but by using Chromium everywhere, developers don't have to deal with cross-browser issues. Case in point: Slack video calls don't work in any web browser other than Chromium, because they don't implement WebRTC properly.

Re:The iOS and Mac markets are almost the same size? by _bxg1 on Saturday March 28, 2020 @05:53PM (#22714602)
> they're fundamentally referring to the underlying engine that makes those apps slow. If that engine was fast and light on resources, the complaint wouldn't exist.

Firstly: in that case you'd have to compare it to the weight of the entire desktop environment. I would bet money that Gnome + your GTK app is not meaningfully lighter-weight than Chrome + an Electron app. It's just that the former has a privileged place in the OS, and is a dynamically-linked dependency instead of a statically-linked one (using those terms loosely).

Secondly: The web itself is not fundamentally slow. People who aren't web developers love to repeat this mantra, but it's simply not true. That's what I'm trying to get to the heart of here:

1) JavaScript is slower than C++, but it's very rare that enough actual work is being done in JavaScript for it to become a bottleneck (on the UI side), even in complex web-apps. Most of the grunt-work, including recalculating layout, is implemented in C++ as part of the browser.

2) Layout calculation can be slow-ish in extreme cases, but that's a direct tradeoff for the benefit of using the world's most advanced UI layout system, which provides real value.

3) Under normal circumstances an entire web page runs in a single thread, which can be a problem when the occasional expensive operation blocks other ones, but Electron gives you several options for moving expensive operations to separate threads. By default the web view runs in a separate thread from the "main" process, and you can spin up workers or even split your UI into separate web views so each panel gets its own thread.

I think the origins of this myth are:

1) Websites have become much slower than they need to be with the increase in JavaScript dependencies. 90% of this is due to ads and analytics, which couldn't care less about their impact on page performance. The rest has mostly to do with the initial load-time of that 1-2MB script, rather than the runtime of the actual JS code.

2) As with any technology that lowers the barriers to making things, there's been a dilution of less-skilled developers putting things out into the world, decreasing the overall perceived quality of the space. But this isn't an indictment of the technology; if anything, it's a complement. It has to be distinguished from the actual merits of the tech.

> but by using Chromium everywhere, developers don't have to deal with cross-browser issues

I think it has more to do with being able to build and ship copies for all systems through a single channel. Building a "first-class" Mac app (a dock icon, hooks into system APIs, etc.) that uses Safari's web view right now would probably mean opening XCode and writing quite a bit of actual Swift as a wrapper around the web UI. People don't want to do that; it defeats a lot of the purpose. My proposal in my last comment would solve this problem.

Re:The iOS and Mac markets are almost the same size? by Wowfunhappy on Saturday March 28, 2020 @06:16PM (#22714729)
I don't think that the web is fundamentally slow! I do think Chromium in particular has become a major resource hog. Firefox, which doesn't have Safari's platform advantage, opens more quickly and takes up much less memory than Chrome (even as it still uses up battery quickly). Gnome Web, a Linux webkit-based browser for Linux, also performs quite admirably, so I'm not convinced Safari's success is simply due to its macOS integration.

There've been a couple attempts to build electron-like frameworks that use the OS's native webview, but they don't seem to have gained that much traction. Deskgap is probably the most mature of them, relatively speaking.

https://deskgap.com/

https://github.com/pojala/electrino

https://github.com/jscherer92/Quark

Re:The iOS and Mac markets are almost the same size? by valuearb on Sunday March 29, 2020 @02:37AM (#22716894)
Strange, I’ve always thought Electron apps felt weird and slow. Slack has improved, but it still wigs out in low network situations.
Re:The iOS and Mac markets are almost the same size? by nottorp on Sunday March 29, 2020 @10:25AM (#22719214)
The Slack UX that crashes and self reloads when you read a conversation and don't click on anything?
Re:The iOS and Mac markets are almost the same size? by saagarjha on Saturday March 28, 2020 @03:48AM (#22709838)
In user interface, sure. Performance-wise Electron usually loses even to things like GTK.
Re:The iOS and Mac markets are almost the same size? by _bxg1 on Saturday March 28, 2020 @11:43AM (#22711769)
Every GTK app I've ever used that didn't come with the OS (granted, I've never actually paid for one) is, compared to most electron apps, a) ugly/buggy, and b) feature-anemic, because it's so much less easy to add features to it. And as a user, I've never noticed a performance difference. I know Electron uses more memory and such, but it just doesn't impact actual usage in my experience. Whereas things not getting implemented because of developer friction absolutely does.
Re:The iOS and Mac markets are almost the same size? by arvinsim on Saturday March 28, 2020 @01:31AM (#22709444)
I think he meant the developer, not the user experience is better.
Re:The iOS and Mac markets are almost the same size? by sdegutis on Saturday March 28, 2020 @02:14AM (#22709566)
Really I was just thinking of VS Code and a vague memory of some other Electron apps I've used in the past, excepting one in particular which I will not name. But VS Code is just great.
Re:The iOS and Mac markets are almost the same size? by chipotle_coyote on Saturday March 28, 2020 @02:45AM (#22709658)
VS Code is the proverbial exception that proves the rule. :) It's kind of frustrating that there seem to be so few Electron apps that live up to its standard.
Re:The iOS and Mac markets are almost the same size? by leadingthenet on Saturday March 28, 2020 @05:14AM (#22710080)
And frankly, on macOS, VSCode isn't even THAT great. The UI certainly doesn't follow platform conventions, the scrolling is janky, and it just feels out of place.

Additionally, I have yet to encounter a single native Cocoa app that has such a strong effect on battery life.

Re:The iOS and Mac markets are almost the same size? by nottorp on Sunday March 29, 2020 @10:27AM (#22719224)
When the developer doesn't have experience with anything but JavaScript...
Re:The iOS and Mac markets are almost the same size? by sdegutis on Friday March 27, 2020 @08:58PM (#22708283)
* I’m practically never so productive that I’m counting seconds for an app to open.

* VS Code is just as quick to use as Xcode, actually more responsive in many actions, demonstrating effectively that it’s the algorithm which must change for a serious speed up

* MBP batteries are laughable in the first place and they’re basically portable desktops that need to stay plugged in all the time

* The rest of the OS hasn’t behaved consistently with itself the whole time I’ve been using it, just like every other OS I’ve used for the past 25 years; consistency was a pipe dream

Re:The iOS and Mac markets are almost the same size? by WoodenChair on Friday March 27, 2020 @11:37PM (#22709016)
> * MBP batteries are laughable in the first place and they’re basically portable desktops that need to stay plugged in all the time

Probably because you’re using so many electron apps. This is not the case in lab testing by MacWorld, etc.

Re:The iOS and Mac markets are almost the same size? by sdegutis on Saturday March 28, 2020 @02:16AM (#22709574)
More likely the 7 years straight of full time development I've done on this laptop, constantly running compilers and image editors and browsers. I could complain about those too but in the end, laptop batteries have to support the software that exists, not the software in a hypothetical ideal world.
Re:The iOS and Mac markets are almost the same size? by saagarjha on Saturday March 28, 2020 @03:51AM (#22709840)
My Mac (just over three years old) reliably gives me 7+ hours off a full charge if I’m not constantly compiling anything; just reading mail and Hacker News can easily give 10+ hours. I very actively ensure that Electron is never running on my Mac.
Re:The iOS and Mac markets are almost the same size? by Klonoar on Saturday March 28, 2020 @04:50AM (#22709999)
I'll second this opinion - when I don't have Chrome running, my 2015 MBP runs forever.
Re:The iOS and Mac markets are almost the same size? by read_if_gay_ on Saturday March 28, 2020 @03:24AM (#22709760)
If the thing is 7 (!) years old it’s no wonder the battery is done. That is not an issue with Mac batteries.
Re:The iOS and Mac markets are almost the same size? by tomc1985 on Saturday March 28, 2020 @01:35AM (#22709459)
Disagree on all points...

"Counting seconds" may mean little to you but by proxy you can look at conversion statistics for web stores vs response time and see a pretty clear correlation

VSCode's 'performance' is the result of an obscene amount of tuning the base framework, far more than most applications would need. Most other Electron apps do not see anywhere near this level of optimization (and they desperately need it).

MBP batteries on a new machine are respectable. Like all li-ion batteries they decay with use

Mac OS apps behave very consistently when they are native. True, Apple's user interface guidelines allow for pretty wide latitude in some areas (like skeumorphism) but all the basic OS/interaction contracts are intact. One can expect menus to behave the same way, file open/save dialogs to behave the same way, and so on.

Re:The iOS and Mac markets are almost the same size? by sdegutis on Saturday March 28, 2020 @02:20AM (#22709584)
First of all Apple does not follow its HIG in many ways. But even aside from that, the HIG itself changes every few years, sometimes drastically such as the iOS 7 departure. And it takes many apps time to catch up. One example is Apple's own new Mac App Store which doesn't even allow selecting or copying text in app descriptions last I checked.
Re:The iOS and Mac markets are almost the same size? by leadingthenet on Saturday March 28, 2020 @05:15AM (#22710081)
Apple has definitely been shitting the bed on UI in the past few macOS releases.
Re:The iOS and Mac markets are almost the same size? by saagarjha on Saturday March 28, 2020 @03:53AM (#22709842)
The Mac App Store is a fairly well known atrocity which might as well be a Catalyst app for how bad and out-of-place it is.
Re:The iOS and Mac markets are almost the same size? by tomc1985 on Saturday March 28, 2020 @01:25PM (#22712630)
The ability to copy text from UI labels was never part of the contract. Generally when that happens it was because the label control was some kind of textbox with most of the visual features disbled
Re:The iOS and Mac markets are almost the same size? by sdegutis on Saturday March 28, 2020 @04:51PM (#22714240)
From Mac OS X 10.0, labels were simply text boxes with editable set to false, both being NSTextField, and when it seemed reasonable that the user might want to copy it, you used Interface Builder to mark it as selectable.
Re:The iOS and Mac markets are almost the same size? by millstone on Saturday March 28, 2020 @12:49AM (#22709272)
I mean VSCode is the best Electron app ever made and it still kind of sucks. The median is miles underground.

Consistency is a sliding scale but Electron is a whole new (lower) level. Extremely basic interactions like "the menu bar highlights to acknowledge key equivalents" are missing.