ELECTRON: why people HATE it, why devs USE it

preview_player
Показать описание


👏 SUPPORT THE CHANNEL:
Get access to a weekly podcast, vote on the next topics I cover, and get your name in the credits:

📹 MORE VIDEOS FROM ME

🏆 FOLLOW ME ELSEWHERE:

📷 GEAR I USE:
*Amazon Links are affiliate codes and generate small commissions to support the channel*

This video is distributed under the Creative Commons Share Alike license.

#linux #electron #webdevelopment

00:00 Intro
00:33 Get a free study on open source best practices
01:38 How electron works
02:47 Why developers like electron
06:37 System integration isn't good
10:15 Disk usage and performance
13:03 Linux needs electron
14:54 Get a laptop or desktop that runs Linux out of the box
16:00 Support the channel

So, what IS electron, exactly?

electron is a framework that lets developers create applications using web technologies, like javascript, HTML or CSS. It's open source, and it's cross platform, meaning that apps built with electron run on Windows, Mac and Linux.
ectly inside of the app, instead of being accessed on the internet.

So why do developers go the electron route?

Developing apps using native technologies on all platforms takes a long time, a different set of skills and knowledge for each platform, and so you need more developers, more time, and more money.

Electron lets you develop ONCE.

Second reason: debugging code for web technologies like javascript is pretty easy compared to lower level languages like C, C++, or objective C. Javascript is interpreted line by line, so noticing where the error is is way easier.

Another reason is that electron apps can auto update very easily: all you have to do is make sure that your electron app can detect when the code for your website has changed, and download the new files on your computer, a quick reload of the page, and you're up to date.

But, electron has a bunch of issues as well.

First, electron doesn't integrate really well with the operating system: it's just a web browser displaying a website that is stored on your computer instead of being stored on a server. This means that if electron doesn't support a specific feature of your operating system, the apps using it also won't.

A bigger problem, though, is the fact that developers often don't update the electron base, or not often enough. Electron, using CHromium, needs to be as up to date as any web browser you'd use everyday, to ensure that security flaws are patched.

That's often not the case. And it gets worse when you take into consideration operating system integration. An example is Discord on Linux. It uses an older version of electron, that doesn't support Wayland very well. electron does have wayland support, and good support at that, but Discord, by not updating the electron version they use, deprive users of that support.

And then there's the performance and resource usage. Since electron apps ship basically the whole of chromium's codebase, they aren't small. Discord, for example, once installed, weighs more than 700 MB. Almost a gigabyte. Even the most basic of Hello World applications would take about 100MB, just to display a line of text.

And there's the performance impact: chromium isn't a lighweight browser at all. Discord, again, on my system, with all its processes, uses about 480 MB. And that RAM usage is the same whether the app is minimized to the tray or fully open. GIMP, when opening a new blank document, uses 500MB.

And still, specifically for us Linux users, electron means we get applications on Linux that we wouldn't have had otherwise.
Рекомендации по теме
Комментарии
Автор

TLDR: It makes it easy to develop because you develop once and ship to every platform so devs love it but the end result uses a lot of system resources so users hate it.

swaggitypigfig
Автор

Another point: unused RAM can be used by the kernel to cache inodes (basically, applications/files that are frequently used by the user). RAM used up by electron to duplicate Chromium libraries can’t be used for caching.

Al
Автор

tauri is a new alternative that doesn't share most of electron problems.

katech
Автор

4:30 From a former QA tester: Javascript is only easier to debug if you are using Typescript or a good framework. Vanilla Javascript is one of the worst languages to debug because it can cast data from one type to another without you noticing if you aren't careful and different web browsers will sometimes treat the same Javascript code differently. These can cause bugs in the business logic that can go unnoticed until after the code is in production. Javascript can be awesome IF you have proper tooling around it but the core language itself isn't really that good.

nerdy_crawfish
Автор

To be honest, if Sun/Oracle did not screw up JavaFX, most devs would probably use Java rather than JavaScript for desktop apps.

ingframin
Автор

"Noticing where the error is is way easier." I could not disagree more. In TypeScript, sure, but debugging in JavaScript can be incredibly frustrating compared to compiled languages or even Python using type annotations and a capable linter.

killermonkey
Автор

Just not Chrome. It ships the same JS engine V8 twice. One used inside Chrome & other one used inside Node
Have you encountered extreme foolishness for minor simplicity? Well. If you had it was definitely Electron

krtirtho
Автор

There is Tauri, which is similar to Electron but written in Rust for Rust developement. It's significantly faster and smaller from what I know

ahsookee
Автор

I agree it is better to have apps than not have them. I just don't want Chromium on my computer. I wish there was a Firefox, WebKit, or Servo based solution for developers to make cross platform apps.

ProvAlex
Автор

Another alternative is also Godot, yes, the game engine. Some devs are creating desktop apps using it.

angelobarato
Автор

I'm a developer and I avoid electron whenever possible. Just making a website and packaging it with a browser doesn't make it a good solution, but a lazy one.

Bettehem
Автор

Devs don't have to resort to Electron to make cross-platform apps! GTK and Qt are also cross platform (GIMP and OBS are two examples of apps that meet this criteria). As a dev and KDE user, I've used Qt for my apps a few times, and it seems to work just as well on Windows as it does on Linux. It even picks up the native theme of each OS, but it also lets the dev choose a custom theme for their app (just like OBS does, actually it lets you switch between different themes or the default OS theme).

theodoros_
Автор

To regular Linux users out there: Electron isn't the only cross-platform UI toolkit. GTK, Qt with QML, Flutter, Tauri, can do the same and more in a more secure, efficient, and convenient way.
To Electron developers: Don't fear native development! I used to think everything outside the modern web stack was too complicated, outdated, and unusable. I've learned Go and then Rust, and saw how JS and Python encouraged bad practices. I saw how CSS was just needlessly weird. If you prefer using TS+Electron for your app, it's fine. Just don't be afraid to learn new things.

rkvkydqf
Автор

I'm on Linux just one year, never into informatics, but somehow Linux made me got this new interest.... Channels like this one shows me how dense and multilayered is the infrastructure our lifestyle relies on.

nosotrosloslobosestamosreg
Автор

I personally use Tauri. An Alternative to Electron that uses Webview instead of Chromium which makes it alot smaller and faster. It also uses Rust for the Backend giving it even more peformance!

notarandom
Автор

So basically it is fulfilling the promise of Java back in the 90's, that of letting companies -develop on the cheap by having one team developing for all platforms at the same time- write once, run everywhere. And it still feels as out of place on any desktop as most Java applications.

If anything the one reason I really dislike Electron is because it encourages a que será será attitude towards memory and execution time optimization.

wallyhackenslacker
Автор

Despite personally leaning more towards the user side of the argument, I like your nuanced stance on this sort of things.

hindigente
Автор

The electron is a subatomic particle whose electric charge is negative one elementary charge.

thingsiplay
Автор

As a electron dev I hate electron so much is easy to use but is the literal bloat hell.

daereanlegrand
Автор

Developers love it because tools we use are based on Electron, like VSCode and Obsidian.

ruckboger