In Defense of Electron

dev.to/bitario/in-defense-of-electron

I know it's already a week old but the board is slow so who cares

In Defense of Electron

Electron, a popular framework that allows developers to write code once and deploy on multiple platforms like Mac, Windows, and Linux, has been under a state of steady attack over the past year.

Those against it are rallying to hinder the speeds at which Electron is gaining adoption by new and established startups alike. Two of the most popular tools used by developers today are proudly built with Electron: Slack and Atom.

Opponents of Electron say that “it’s too memory intensive.” Or, “It hogs the CPU.” Or even better yet, “It runs the entirety of the Google Chrome engine in every window.”
Even more, anti-Electron posts are usually filled with charts and tables, along with screenshots of Activity Monitor with memory and CPU usage, outlining the evilness of the framework and why it must be stopped at all costs.

Focusing heavily on how it makes a robot computer feel, these posts ultimately neglect what will be the deciding factor in Electron’s success or failure: how it feels for most people to run Electron apps day-to-day.

Other urls found in this thread:

archive.fo/F345q
en.wikipedia.org/wiki/Wirth's_law
news.ycombinator.com/item?id=15079857
medium.freecodecamp.org/why-i-still-use-vim-67afd76b4db6
github.com/pojala/electrino
fastcompany.com/28121/they-write-right-stuff
twitter.com/AnonBabble

A User’s Perception

By no means am I 'most people'. I use a relatively advanced laptop: a 2016 MacBook with 16GB ram (which came standard). But advanced development machines of today are the entry level computers of tomorrow. Electron’s dream world would be one where every computer user had a luxurious amount of ram. But I think this world is fast approaching. Do we wait till then to begin taking advantage of a plentiful world, or do we start planning now?

If I were a convenience framework developer, I ought to be more concerned with where the trend in memory is going rather than where it has been. The computer industry has been stuck on 8GB for what seems like far too long, but a 16GB standard reality is imminent, if not inevitable.

I can speak for myself when I say Electron runs like a dream. On a typical day, I’ll have about three Atom windows open, a multi-team Slack up and running, as well as actively using and debugging my own Electron-based app Standard Notes. I’ll also have a bunch of other non-Electron apps opened or running, like Adobe Photoshop, three Terminal windows with 3–4 tabs each, Sequel Pro, Google Chrome with on average 4–5 tabs, Apple Mail, iMessage, Little Snitch, Dropbox, and iTunes/Apple Music.

So, how does it feel to run this bloat train of death every day?

Well, it feels like nothing.

I don’t notice it. My laptop doesn’t get hot. I don’t hear the fan. I experience no lags in any application. My music plays seamlessly. I can watch an HD YouTube video without problem. My screen doesn’t flicker. I get notifications. I download new apps and update old ones.

I go about my day, and Electron doesn’t get in the way.

The Business Case

But aside from how it makes end-users feel, there is an arguably more important perspective to be had: how it makes software companies feel.

For context, the project I work in is an open-source cross-platform notes app that’s available on most platforms, including web, Mac, Windows, Linux, iOS, and Android. All the desktop applications are based off the main web codebase, and are bundled using Electron, while the iOS and Android app use their own native codebases respectively, one in Swift and the other in Kotlin.

And as a new company without a lot of resources, this setup has just barely allowed us to enter the marketplace. Three codebases is two too many codebases to maintain. Every time we make a change, we have to make it in three different places, violating the most sacred tenet of computer science of keeping it DRY.

As a one-person team deploying on all these platforms, even the most minor change will take at minimum three development days, one for each codebase. This includes debugging, fixing, testing, bundling, deploying, and distributing every single codebase. This is by no means an easy task.

Sometimes, a prospective user tells me that this app is exactly what they were looking for but “Sorry, I don’t use Electron apps.”

If I were speaking candidly, perhaps I’d say “I regret to inform you that the world you imagine could not exist.”

Let us entertain this user’s wishes by simulating the parallel universe where a small software shop can develop natively on every single platform.

This would mean hiring a total of six experienced developers. Let’s ignore the madenning tediousness of having to make every minor change six times on six different platforms, and focus instead on the costs. With an average salary of $150k (probably more for the hard to find like Mac developers), and ignoring the massive cost of finding and hiring these developers, that’s a total of $900,000 in development costs every year.

For a bootstrapped, non-VC funded company, this quite literally isn’t an option.

Or actually, maybe it is. You can just pass the cost down to your customers.

Let’s assume a goal of two thousand paying subscribers after 12 months of operation. If we wanted to make a company-wide profit of only $100k, this would mean charging each user $500/year or $42/month. Do you want to pay $500 a year for a notes app?

I dare say that these conditions will constrict any new startup looking to introduce a cross-platform solution to the marketplace, and the amazing app that could have been will never be made in the first place.

Perhaps the devil’s deal is not so bad then? You get something, instead of nothing. That’s always good. Two, you get it for a decent price ($36/year for the notes app). And three, you get it on every platform you love to use, with web access in most cases as an added bonus.

My bet is that with the favorable conditions that it affords new startups, along with increasing memory availability in personal computers, Electron will continue to see increased adoption by companies and users alike.

If you’re a developer, you can learn more about Electron here.

You can also see some of the apps proudly built with Electron here.

If you liked this post and want to subscribe to similar stories in the future, you can follow along on Twitter at @bitario, or check out the project I’m working on @StandardNotes, a private open-source notes app.

Forgot to archive dat shit: archive.fo/F345q

Forgot to archive dat shit: archive.fo/F345q
Also, should've broken the first link. Oh well.

en.wikipedia.org/wiki/Wirth's_law

Yeah, it's almost as if they're using hard statistical data to support their argument while all this fuckface has is "feels over reals".

jesus fucking christ a look at those tweets made me regret clicking this thread, now lemme read his fucking diary post

Faggots like this should be crucified. Work on some other shitty shit for fucks sake. There's already org-mode, workflowy, etc. Who the hell needs another note taking app.


Did this guy just learn javascript and is now larping as a startup ?


Getting shit instead of nothing is alwasy worse.

Steve Jobs' colon got something instead of nothing too.

And how exactly is that bad ?

Ignore me I misread what I replied to.

Is this real life?

It's a valid argument. Look at Android - it's a bloated, hitching, laggy mess because of Java. It might even take a couple seconds in some cases to react to a screen tap, and normalfags hate that. It eats gigabytes of ram to tell you the weather. And yet it's incredibly successful.

Android hasn't actually used JIT/A Java VM since like 2012. Android uses ART (Android Runtime) now which is basically install-time compilation instead of just-in-time compilation. And even then most Android apps are written in C via the bionic C library. Retard

It's either cheap shitty android or really expensive iphone.
not much choice

Have you ever used an Android? People write most apps in C, and Google are pushing a move to Kotlin. But that's besides the point. Stock Android has always been pretty fast and has very reasonable memory usage

As usual jew news is full of mental gymnastics.
news.ycombinator.com/item?id=15079857

WTF am I reading? Just write the core in a portable language, and then just wrap the GUI around it in whatever framework is appropriate. Problem solved, now adding a new feature is done once for all platforms together and hooking up the GUI is usually trivial as well. Most of the GUI-related work is not writing the code, but designing a well thought-out interface.

Kek, I'm using VS Code for some time already, it's written in electron from what I know and I see absolutely no problems performance wise. Didn't even knew that rabid autists with their 15 years old thinkpads organized some retarded movement dedicated to attacking it. In fact it's working so well that if I ever have to write some client application, electron will be what i'll use for GUI most likely.

...

It's not bait though. Sperglords conserving their 512MB of RAM won't be target of any commercial, multi-platform project and this is what things like electron are useful for. Also, using one technology stack for web and client apps instead of learning dozens of shitty GUI frameworks is extremely comfy. I sincerely hate front-end and the lesser amount of time I have to waste on this shit, the better.

How many commercial multi-platform apps currently use electron?

VS Code
Atom
Slack
Discord
Skype (new client)

I haven't yet heard anything bad about VS Code, but the other ones are slow CPU demanding, memory hogging pieces of shit, prime examples of , directly due to their use of electron. Pics related.

Spot the electron shill.

89iq-tier question. It's not like companies release lists of software they develop and use internally and lists of technologies they used in each case.

Classical case of confirmation bias tbh. You bunch together some random software using one GUI technology and then blame all problems with said software on this technology. Cuz software that uses some shitty GUI technology of your choice is flawless. Also

I don't really care about Electron but it really hurt to read those tweets. Are people really this dumb now?

AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
END THIS INSANITY

They need all that memory for bugs, emojis and various retarded anti-features.

No, its the wrong timeline in which Lisp Machines and Xerox Parc lost.

i imagine it feels like your ass bleeding while a dick is in it
electron is nigger shit, end of story. embedding web into "real" software is a whole new level of retard and probably causes tons of security vulnerabilities that not even C programs have

I'm instantly mad with the repetition of "with", he could have easily used "on" for the second word.

electron solutions use too many resources for small single problems but that's how everyone uses them, gross.

The "made with

medium.freecodecamp.org/why-i-still-use-vim-67afd76b4db6

Memory usage for opening a 60 byte file
Atom: 250mb
Vs Code: 350mb

Memory usage for opening a 6mb file
Vim, Nano: 12mb
Atom: 850mb
Vs Code: 400mb

Startup time for opening a 6mb file
Nano:

You know something is wrong when "text editor" and "250mb" are in the same sentence.

github.com/pojala/electrino
Obviously it won't do anything for the CPU/RAM/GUI problems inherent to desktopified web apps, but it's hilarious just how Electron managed to get every possible thing wrong.

I don't understand this. If devs want to use 'web technologies', why not just make a web app?

Sublime is pretty nice, desu.

wow vim is fucking shit, why use vim, nano is fuckin superior :^)

Seriously though, why is 1970s CLI software eating up megs of RAM and seconds of CPU cycles? I know eunuchs was always the bloated whore of OSs among microcomputers, but it should be using under 1K of RAM and starting up in one screen refresh on modern systems.

Memory usage for opening a 60 byte file
Xi: 60 bytes

Memory usage for opening a 6mb file
Xi: 6mb

Startup time for opening a 6mb file
Xi:

could be a couple of things

Some of it will be used for drawing the terminal user interface, since neither vim nor nano are actual CLIs. Although vim does not use the ncurses library, it must perform similar functions to it to keep track of everything on the terminal. In my experience ncurses alone eats up 750K or more of RAM. Additionally, vim does automatic syntax highlighting which could take up a fair amount. The article also shows how ridiculously fast vim is at search-and-replace; this must come at a cost to memory. Storing more things in RAM makes the computations easier.

user are you disabled?

It's not me that is disabled here.

I'd use Vim too if I was developing on refrigerator or microwave - thank god I have a laptop.

kek

It's cute watching morons throw made-up numbers around when everyone knows the minimum page size on any CPU is 4k.

kys

Welcome to the tech industry in CY+2.

Since the thread has a lot of talk about text-editors, I got curious the other day while using `less` how many text-viewers there were. Does anyone know of any popular ones? `less` seems to be the most used on cli and I guess your file managers preview pane is the most used for GUI reading.

I tend to use gVim for gui editing and reading, and sometimes I use FreeBSD's ee for reading or minor edits on the cli, I tend to only use less as a pipe outlet.

Nobody uses vim in compat mode, nitwit.

`most` is better.

there's the usual cat, more, but if you want something like using your file manager to preview things but in the terminal/console, you could use ranger to have a limited view of text files

ranger is okay

This shit legitimately makes me mad. This is how the modern phone has a multi-core CPU clocked over 1 GHz with many gigs of RAM at its disposal, yet all the software on it still runs like dog shit compared to 90's era software.

Better hardware _is_ intended to run software better, not to allow more room for developer laziness.

...

Ditto. If a developer saves a week of work, but in so doing forces thousands of users to waste a few hours, or millions of users a few seconds, that is a massive own goal.

This entire idea of using toolchains originally intended as rapid prototyping systems, for end-user products, is the sort of thing that would've gotten engineers publicly executed in saner times.

is textadept okay? it's open sores and written in c/lua

kys

Isn't this meme too old, like something Bill Gates said in 80's about computers double speed every 18 months and software gets double bloat every 12 months?

Too many programmers view themselves more like artists or wizards rather than craftsmen or engineers. This is the consequence of the incestuous ivory tower Silicon Valley culture degenerating from intelligent nerds to pretentious nerds.

Craftsmanship is not valued any longer, it's about feelings and appearance, quality be damned. That's all just an outdated social concept. You notice it with all these modern tools which look fancy but perform like shit. Can you imagine a construction worker choosing his jackhammer based on which one will look good in a coffee shop? Fuck no, his jackhammer will be an ugly worn-down machine, but one that he knows every detail of and which he maintains religiously to always be at peek performance.

We need manly culture in programming, the type where quality and sturdiness is valued. Sadly, customers have been raised on shit technology and don't really care. Imagine growing up in a world where every building is built like shit, walls always crack, roofs are always leaking and weed is sprouting through the floor. You would simply consider it normal and if someone told you that things can be better you would just shrug it off because that's what you are used to.

...

dude

This. It all started with C++. Luckily, Russia and China will save us all.

...

...

Remember when text editors used to occupy around half of system memory back in 80's, how systems were single-task and handled the buffer overflow? You don't, lil kiddo. So shut the fuck up and stop whining about one program designed for human productivity, not for robots, that occupies 150 megs of ram on your 8-core computer with 16 gigabytes of high-speed memory.

Contrary to popular belief among imageboard autists - programming is pretty difficult task that demands lots of patience and time spend on genuine learning which is what majority of people hates. Even pleb imperative languages like C and its derivatives take lots of time to learn and understand. This paired with the fact that there's trend to automate every possible task in business and comercial environments simply creates shortage of capable programmers so the ones that exist don't have to put too much of effort into their work. And I see nothing wrong with this tbh - retards that dream about world where you have to hand-optimize in assembler everything you write to stay afloat cuz there's shitton of highly capable programmers you have to compete with, should kill themselves.
Also, don't get me wrong - it's not that I do programming exclusively for money - I can spend lots of time polishing project that I'm genuinely interested in but havig to put any effort writing some boring shit for some equally boring faggot that I don't care about makes absolutely no sense. In such cases i will just assemble some shitty app from dozen of most available frameworks/libraries and, even with 20 seconds load time or 300MBs of RAM wasted, any user will still do his task hundereds, thousands or even millions of times faster than he would if he had to do it without any software.

...

The same goes for any other profession as well. If it wasn't hard people wouldn't pay you to do it.

well, they view themselves as wizards because they view computers and software as magic, because a).
they like to just throw shit together until it does something, and b.)
they have created such ungodly clusterfucks that they feel their operation may as well be magic.

That's Engineering though.

There is nothing wrong with that. There is everything wrong with shipping that as the finished product though. Electric engineers have breadboards for quick and dirty experimentation, but once they have figured it out they move to actual production-grade hardware.

If people were using Electron simply to throw together quick & dirty prototypes to experiment with no one would have a problem with that. But shipping an Electron application is like putting a breadboard in a case and shipping that as a finished product.

If market is ok with it then why not do it? Are you some commie workaholic? This software does it's job for ~99.9% of the people, RAM-obsessed weirdos with decade-old thinkpads never were or will be the main target.

Throwing shit together is not engineering. Imagine if buildings were build just by throwing some shit together. We would never build anything higher than 2 stories. Engineering is application of mathematics and other sciences to build something. Building on pic related is build that way for a reason. Someone calculated weight distribution, material properties, effects of wind on building, layout of electrical wiring, HVAC, plumbing...

Problem with software is that is build way too fast and there are no standard well tested premade components available to use. Things are being built on top of things that aren't yet finished and fully tested. Look at Firefox: rather than fixing security issues, memory leaks and engine problems they update fucking GUI to conform to latest "what public likes fad". Oh and those plugins you have. We're sorry but they will have to go. But hey, we fucked up architecture so badly that we're already developing next thing called web assembly, you won't need plugins anymore. Fuck you.

Shit like this is why most software development is not engineering. It's an insult to actual engineers who create things rationally based on models of reality, something that is unheard of in software world.

American education.

Yeah, cuz it's totally not like 1% of all engineers is designing constructions like these while rest is busy making blueprints of cardboard houses for average poorfags.

Well, if you're fine wasting your life making shit just because it sells, that's your problem. Some people (you know, the ones with dignity) are simply disgusted just by being involved in the making of this retardation.
I guess that's lolbertarians for you.

That's an arguable point, sure. But the problem still goes back to what I said, so even if it's just because people don't pay for good enough software, the amount of money people waste because of sucky software far outstrips the price of better software.

I suppose a perfect case study (aside from their being purely for recreation rather than productivity) would be mobile games. People always complain that they're garbage, but whenever anybody tries to sell real games for $60 (or even shareware-grade stuff for $30) everyone bitches that it's "too much for a mobile game".

It's true that the worst problems of this type are in the realm of free or cheap software, like IM clients and web browsers, but some obvious examples of really awful software that still cost a lot exist, such as MS Office or Oracle Db, and all of their competitors.

There are indeed many market segments in which users are too stupid to pay enough for software that would meet their needs, but there are also many where every single option sucks for no other reason than the sheer incompetence of developers with more than enough resources to do it right.

I can tell you're not a programmer.

Skype is a fucking dumpster fire. How the fuck can they possibly make it run so slow?
I heard this text editor is the hot new cool these days, and gave it a download. The installer is over 150 megabytes. For a text editor. Nope.

ugh, these guys are so annoying.
that's where you're wrong, kiddo.
you seem butthurt, but you are committing a logical fallacy of comparing apples and oranges

Alright, you asked for it:
fastcompany.com/28121/they-write-right-stuff

You live in ideal world where everyone uses C and Unix combined with purposefully made libraries targeted towards solving very narrow set of problems. In reality most software is not built using those components. It is built on top of experimental frameworks which change constantly. That's even the reason why are we having this thread in the first place. Is then electron, by your definition, then one of those hundreds of libraries for everything you need? If it is, then my definition of standard well tested premade components needs updating.

Why do we have hundreds of GUI libraries/frameworks then? What is wrong with GTK that now we need something like electron? What's wrong with Swing? WxWidgets? Cocoa? .NET? Why are we not using TK or ncurses?


Be my guest, name some of those components.

libc.

No production software is built on experimental frameworks.

The GUI problem is use case, with a sprinkling of Windows and politics. Variety is the spice of life.

This; and the people that respond to you trying to justify their lack of work ethic only go to prove it further.

because that just worked so great before, right?

I'm not going to name any names, but I know of one startup which is trying to sell a fucking Raspberry Pi 2b in a box as a serious professional security product. Meanwhile, pajeets / shit programmers are infecting everything hardware with Node.js cancer.

May God have mercy on our souls

I remember making a joke a few years back that we will have self driving cars crashing and creating mass death/destruction because of the underlying software being a bunch of Node.js modules stuck together by pajeets.
Hopefully it will remain a joke.

Things usually get a bit better when there's a multi-billion dollar lawsuit on a company's hands.

...

You think if you blind a self-driving car it will panic or something? It still has an internal model of its surroundings, it's just not being updated anymore. Plus it still has range sensors all around.

Your plan would work much better on humans.

...

The camera will break. It would also be possible to put up false signs, attacks like this have been demonstrated.

Who are you quoting? Because that's not what I said (or implied) at all. My point was that using lasers to blind human drivers would have a higher chance to cause a crash.

A message will notify the passenger that the sensors aren't working properly. The passenger will either notify someone to tow the car to repair or the car will do it on the passenger's behalf.

You can equally put up false signs to fool human drivers. It will be assured that someone will report the discrepancy to the authorities and it will be fixed quicker than you realize.

No attacks have been demonstrated.

False signs can also be beaten by the signs being on whatever map the cars use.

the lidar attack was exactly this iirc. regardless of your retarded shit, self driving cars are just software and as such will have exploitable edge cases that can cause them to crash.
"it would work better on humans shit" is just some retarded sophist propaganda