PSA 

Electron apps are not really apps, they are just web pages with rudimentary heavy-weight browsers included.

If you are about your users' well-being, please, don't use Electron in your project. Using more than 300 MB of RAM and slowing down the whole system just to edit a small text file or send a chat message is a sin.

Thank you.

Electron rant 

Some people think and even more people say that Electron is being bashed because it's cross-platform, and this is supposed to rob the FOSS Unix ecosystem of its users because there will be no reason to use it then.

Not true!

FOSS has always been OK with cross-platfom development, as far as I can remember. Moreover, it always has been FOSS' schtick: almost all significant Linux apps could be compiled for Windows - GIMP, Pidgin, Mozilla, just to name a few. We don't hoard our programs, cross-platformism is encouraged.

No. Electron gets bashed for whole different reason.

And not because it's lazy. Being lazy is a good thing in most cases.

Electron gets bashed because it's lazy AND bad. Because it assumes that everyone is rich enough to have the latest and greatest gear, that memory and CPU are cheap, and they are cheap everywhere, so they can be wasted on bullshit. Because it thinks that optimization is not necessary. Because it's careless with the users' resources.

Show thread

Electron rant 

And looking at how much stupid bullshit is there in Electron, this is basically akin to running a virtual machine with a separate operating system just to run one small piece of Javascript. This is not what is called cross-platform.

It reminds me of "Linux" versions of proprietary programs of mid-2000s. Don't sweat it, just slap Wine on it, and ship it for Linux. I used to get angry at stuff like this. But Wine at least didn't hog as much resources as Electron.

Show thread

Electron rant 

And to top it off, you'd think that an app which ships in distributions of at least 100 MB and eat 300 MB of your RAM from the start will at least look the part, right?

Wrong.

Most Electron apps are flat, boring, ugly and almost always a chore to use.

I remember times when Unreal Tournament shipped at 500 megabytes. A full game, and beautiful one at that, by that time. And the kicker? It ran on 32 mb RAM computer. Without 3D acceleration. Slowly, granted, but it did run and was playable. An Electron app would kick in the towel the microsecond it started on such machine.

Show thread

Electron rant 

@drequivalent
Только консоль только хардкор. Я уже отвыкать стал от проектирования форточек. Если уж совсем никуда без морды, то на худой конец проще вэб сервер поднять.

@inhosin не, ну "только консоль" это уже другая крайность.

Когда есть такие языки как Rust и Go (который кстати таки научился в компиляцию только нужных объектов из библиотек. Бинарник, конечно, все равно выходит не самый тощий, но уже не сотни мегов как у Электрона) - и тулкитов вроде Qt (который при всей моей недолюбви к нему, является истинно кроссплатформенным), вообще нет никакого оправдания транжирить ресурсы пользователей убогим Электроном, если прямо страсть как хочется кроссплатформы.

Electron rant 

@drequivalent А каким кодоредактором сейчас кошерно пользоваться. У меня Atom для всего, что программируется и Brackets для веб.

Electron rant 

@rplatonov
Я vs code использую например
@drequivalent

Electron rant 

@rplatonov
Только смотря для какого тебя языка программирования надо. Хотя там почти всё можно, главное нужные плагины поставить.
@drequivalent

Electron rant 

@inhosin спасибо! VS Code оказалась именно тем, что я искал. Сижу, кропая прожку на Питоне.

Electron rant 

@drequivalent Apparently #Electron app devs want users to devote their entire desktops to just the app -- by literally monopolizing all system resources at once and rendering any other program unloadable. No distraction. No competition.

Electron rant 

@dazai Well, yeah. It's not only app developers who do that though. Self-importance is a human problem, not a computer technology problem. Electron is just a manifestation of that.

If you studied in the university, you know what I'm saying. Every teacher of every subject on your curriculum, no matter how irrelevant to your actual speciality, thinks that their subject is a glorious gift to humanity and the very most important thing ever that you should definitely know, so they won't let you get away with C until you answer the material as if you're going for an A+. Other subjects are just nonexistent to them. And really, what should they do? Give in? No way. That would be going against all they are about!
Thus, the dreaded examination seasons, when you cram 5 subjects across three days.

Electron rant 

@drequivalent I noticed the same while working on @homeworldsdl .

The game takes around 60MB of memory on average, and runs on about 2% of my i5 CPU.

Compared to that any popular SPA like slack, takes 500MB and 5% of my CPU. Just for a bunch of javascript and css. (And that's not even talking about electron)

Electron rant 

@drequivalent Yup. The developer is making the choice to force their users to pay thousands of times over for their one-time convenience.

Electron rant 

@freakazoid @drequivalent that core reasoning, "...computers are good enough that we don't need to optimize (much or at all)." is behind my personal dislike for most of the bits of tech I genuinely hate.

's why I dislike (most) operating systems almost by default.

Most squabbles (nano/vim/emacs, Mac/Win/Nix/etc) are about *preference*, and at heart I really don't care.

-
Failure to be cognizant of tech barriers, especially when claiming "moar compatible", is *deeply problematic*.

Electron rant 

@eryn @drequivalent Right. It's true that we don't need to use hand-coded assembly anymore (and in fact that's often worse). It's also true that we can often use interpreted or higher-level languages that don't produce such optimal code. And we can use libraries with relatively abstract APIs rather than having everything be purpose-built all the way down. But once you're throwing in a whole browser and two different JS runtimes you've gone too far.

Electron rant 

@freakazoid @drequivalent this is also applicable in reverse tho? As a developer, are you saying I should be forced to spend 10x as much effort because you can’t spare a few 100MB of RAM?

Not applicable for large co’s, ofc, but many Electron apps are made by individuals. Their time and resources are valuable too.

Electron rant 

@nornagon @drequivalent It's not 10x, and no, I'm not saying *I* should be able to do that, but your hundreds or thousands of users together certainly can.

Electron rant 

@drequivalent @nornagon A popular electron app doesn't use hundreds of MB of RAM; it uses terabytes of RAM.

Electron rant 

@nornagon @drequivalent Also, we're asking developers to put in the effort ONCE to learn something better, at which point it's more like 20% more effort, if even that. And now they can make more money professionally programming too rather than spending the rest of their lives as "web developers" who can't be bothered to learn any actual programming skills.

Electron rant 

@freakazoid @drequivalent whoa wait the fuck up, web devs aren’t “fake programmers”.

Electron rant 

@freakazoid @drequivalent @nornagon whoah, look at mr big shot non web developer here. where can i go to uni to learn to slag people off like that?

Electron rant 

@freakazoid @drequivalent @nornagon
It's too bad, because if people aren't willing to let go of this pretentious idea that accessibility makes an stack less serious, then I don't see a particularly bright future for more performant platforms or users with lower end hardware.

Electron rant 

@riga Again. Electron gets bashed not because it's accessible.

If something helps someone write good software with less effort (very easy-to-learn languages like Python or modern ones like Go and, if you're willing to go little further, Rust) - more power to them. I'm sure even Javascript can be used a lot more efficiently, with something like Qt, given the bindings.

Electron gets bashed because it's inefficient, wasteful and low-quality.

@freakazoid @nornagon

Electron rant 

@drequivalent @freakazoid @nornagon I agree with that, but I wonder if people appreciate how good the ergonomics of the stack is compared to the alternatives. With Electron, I get to use a simple functional architecture that has very predictable properties. I get to use a well-designed language that balances simplicity and safety (Typescript) I get to use an extremely well-documented and supported set of libraries and API's.

Electron rant 

@drequivalent @freakazoid @nornagon Frankly none of this stuff is trivial, and if I'm writing software in my off-hours, it's going to be decisive.

Electron rant 

@drequivalent @riga @freakazoid "inefficient" definitely. "Wasteful" is debatable. "Low-quality" I take some offense to, since I'm one of Electron's primary maintainers :)

Efficiency is something we as developers can choose to reasonably trade off against, it is not the only measure of quality.

There isn't an all-around better solution today for what Electron does. Better on one or two dimensions? Yes, of course. At everything? No.

Electron rant 

@nornagon
Wasting people's resources on bullshit is low-quality programming and shouldn't be legitimized. For fuck's sake, the program that put man on the moon was 4 kilobytes in size.

josephg.com/blog/electron-is-f

@riga @freakazoid

Electron rant 

@drequivalent @nornagon @freakazoid “To be clear, javascript on the desktop isn't the problem. In fact, I think the APIs work with in the modern web are way better than the APIs that exist on desktop. We should use them.

But we need ways to use those nice new paradigms (react and friends) on the desktop without running more blood copies of chrome. “

I agree...

Electron rant 

@riga
I looked at react-native-desktop. It's not MUCH better than Electron (still couple hundred megs of RAM), but at least it's not including whole damn Chromium for crying out loud!
@nornagon @freakazoid

Electron rant 

@drequivalent @riga @freakazoid heh, Joseph is an old friend of mine :)

See also this post of his about tribes: josephg.com/blog/3-tribes/

What is it about using more resources than necessary that bothers you? Is it inherently irksome (i.e. you value efficiency for efficiency's sake)? Or is there something beneath that in your value system that makes efficiency important?

Electron rant 

@nornagon Efficiency for efficiency's sake, sure. Efficient is beautiful.

But most important, I think the devs should think about not only themselves but also others. The more efficient your shit is, the less pointless work it does, the less time and resources it consumes, the more shit the user wiil be able to do.

Imagine if everybody starts using Electron. When the user starts three simple-ass apps and the home supercomputer they blew at least a thousand bucks on starts to slow down, overheat and make strange noises, that's not good user experience. You'd think that the community have gone insane! So why should Slack or Riot or Atom get a pass?

By pushing bloated crap, we're creating quality of life problems for our users, which are, in the end, our most valuable asset.

@riga @freakazoid

Electron rant 

@freakazoid @drequivalent open source is full of people who think they’re entitled to developers’ labor. I think that’s a pretty shitty way to treat someone who gave you a gift.

And it absolutely could be 10x, for some apps/developers.

Electron rant 

@drequivalent
Thank you for expressing my feelings for electron much better then i could at this moment.

#electron must die

re: Electron rant 

@drequivalent also remember the WIN4LIN Linux kernel shenanigans ? yuck

Electron rant 

@drequivalent "it assumes that everyone is rich enough to have the latest and greatest gear,"

That's what I hate the most, is when webdevs shame people for not buying new hardware, which is wasting money and creating e-trash, to run their app because they couldn't learn any other framework.

I see the same in gamedev communities - Someone makes a "minimalist indie" game in "modern OpenGL" which is code for 'it needs an Nvidia Titan to run' and crashes on Intel. I target GLES2.

Electron rant 

@drequivalent Not to mention the "Free RAM is wasted RAM" myth which is so obviously wrong that it's offensive.

Free RAM is the kernel's business. That belief is the Flat Earth of programming.

Electron rant 

@drequivalent Really offtopic but once I was debugging a Lua game that was leaking memory.

Someone online told me it's normal for scripting langs to leak memory, that I should get used to it, that I was mistaken.

I told them that based on my knowledge and experience they were full of shit.

Finally I found the bug: I wasn't popping the Lua-C stack, and so it was leaking a stack frame on every game tick.

"Lua doesn't free memory". For fuck's sake. Of course it does.

Electron rant 

@CharredStencil and what else interpreted languages are for if not for managing (assigning and freeing) memory and other resources? Granted, they do poorer job of it than manual management, but still.

Electron rant 

@drequivalent They apparently thought that every single app just naturally leaked memory, or at least never freed memory when it freed objects. Meanwhile I had a Lua IRC bot running for weeks.

Even worse, I don't think this was the same person who told me that all apps have a busy loop (Not an event reactor!) inside them. There's two of these people out there.

I guess taking an operating systems class and using Qt for a couple years made me an expert in the field. Where's my Phd?

Electron rant 

@CharredStencil Free RAM is free RAM goddamnit. That means, it's RAM that I can use for something that is not your app.

Electron rant 

@drequivalent Like an instance of Chromium that actually does something useful.

I don't know why anyone uses the Slack desktop app - Running two Chromiums that can't de-dupe their pages must be awful on RAM.

@Dr. Equivalent the Incredible It's quite hard for some developers to realize that their apps is not the center of the universe, that user actually doesn't pay them as much attention as a dev think. It also goes with social rules - like don't park on a sidewalk, walk on the right side, let first people who quit the building - I have a theory that there is a correlation between those matters and the way a developer writes his app

Electron rant 

@CharredStencil @drequivalent Now you've got me thinking about how Maciej Ceglowski describes just how massive Apple's webpages are. Sounded a little bit like an auction to me.

Electron rant 

@drequivalent a lotta apps wouldn’t exist on Linux at all if it wasn’t for Electron

@drequivalent Electron is the techbro platform. As we know, techbros don't give a fuck about poor people.

@dtluna
If you are a 'tech' bro, the name would imply that you would at least care about tech. We used to be proud of people who would fit an entire OS on a floppy, or make a demo or a game with advanced graphics techniques that could run on a potato with amazing stability and framerate. Methinks, someone who pushes for grossly inefficient frameworks and legitimizes low-quality programming and thinks optimization is a myth is not much of a 'tech', bro.

PSA 

@drequivalent Not even rudimentary. A full blown browser. And a copy of NodeJS.

PSA 

@freakazoid @drequivalent *out of date full blown browser and old copy of nodejs.

Sign in to participate in the conversation
MastodonSocial.ru

Русская нода социальной сети "Мастодонт", части Fediverse - всемирной федерации социальных сетей. Зона общения, свободная от рекламы и шпионажа, теперь и в России.