ELECTRON: why people HATE it, why devs USE it

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey everyone this is nick and if there's one technology that is divisive between developers and users it's electron this thing basically packages a website inside of a chromium browser and ships it as a desktop app and while it has many advantages for developers it also has many issues for their users so let's take a look at electron why developers generally love it and why users often hate it but you know what people really like these days these segways to today's sponsor this video is sponsored by tuxcare but this time i'm not going to talk about their services to handle and manage your linux server fleet this time they are giving you access to an independent study by idc peerscape that analyzes if when and how to implement open source solutions alongside commercial ones and no before you ask tuxcare did not influence this study at all either financially or in terms of messaging it's completely independent we probably all agree that using open source software can be beneficial to any organization companies traditionally focus on using an optimal mix of commercial software and community supported open source software to try and get all the benefits while minimizing the potential risks this study that you can get for free discusses the five best practices for organizations to determine when where and how to use community supported open source software alongside commercially supported software so click the link below to download the full report and learn about open source best practices so what is electron really because you can't truly hate something if you don't really know what it is electron is a framework that lets developers create applications using web technologies like javascript html or css it's open source and maintained by the openjs foundation and its cross-platform meaning that apps built with electron run on windows on mac and on linux it allows developers to build automatic updates inside of their apps to integrate with the menuing system of the operating system and with its notifications and it is used by a lot of different applications like vs code whatsapp microsoft teams discord slack twitch and a lot more basically it lets a developer build a website or a web app wrap it inside of a chromium browser without all the browser controls and distribute it as if it was a native application the only difference with the regular website that you would access through your browser is that most of the files the website used to display its content are directly inside the app inside of being accessed on the internet so why do a lot of developers favor the electron route instead of developing a truly native application for all systems um excuse me but electron is native to all operating systems yes yes okay but in this video i'll be using the term native application to refer to apps that were developed using toolkits and frameworks that are platform specific like gtk or cute on linux or uwp on windows or cocoa and objective c on mac os okay so the first reason why developers favor electron is obvious developing apps using native technologies on all platforms takes a long time a different set of skills and a different set of knowledge for each platform and so you do need more developers more time and more money using electron you can develop your web app accessible on the web through a regular web browser and that code can be reused as is to make your desktop applications because all electron does is grab that website and pack it into a local app of course some electron apps do a bit more than this and aren't just websites but that's what most of them are so you develop just once and every time you update your website for example you just need to make sure that the electron apps grab those updated files download them reload the page and boom you're done you don't have to spend the time redeveloping the same feature on three four five different operating systems with different languages and different toolkits second reason debugging code for web technologies like javascript is pretty easy compared to lower level languages like c c plus plus or objective c javascript is interpreted line by line so noticing where the error is is way easier okay and now all the developers in the comments can tell me how wrong i am and how rust or python or anything else is just a better language than any other language on the planet all i'm saying is that it's relatively easy with javascript to know where you messed up and where the error is located another reason for developers to favor electron 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 you do not have to cater to a software store that will review your update take three to six days to approve it or even flat out refuse your update now on linux it's not really an issue anymore as developers can self-publish on flat pack or the snap store and everything is generally pretty fast but on mac os or windows the review process can take days so if you have a critical bug fix for your users you would probably prefer if that fix was deployed immediately as it's ready of course it also means that developers can push whatever they want to users without any control from the platform holders for example windows or mac os so if their repo gets hacked any malicious hacker can push whatever they want to the application itself and there are a bunch of other reasons testing your application is extremely easy without long compilation times and the community around electron is huge so you have plenty of online resources to help you get started or to help you solve problems ultimately electron lets companies focus on what they want to do which is building more features and improving their application they don't have to spend more time or more money on different developers they can hire often cheaper web developers instead of ones that have the skills for each specific platform they don't have to waste time re-implementing stuff and it also kind of lets them bypass the store updates policies which companies tend to like so generally for companies electron is a win but electron also has a lot of issues while it generally makes the developer's life easier for the user it's less clear-cut 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 for example electron discontinued support for 32-bit systems so if you have an older computer none of these electron apps will work even though the website itself would work perfectly well since the application also doesn't use a native toolkit like gtk or cute on linux it also won't respect your theme your accent color your icon theme your header bar preferences all those things it might support dark mode because that's something that's baked into chromium and into electron but that's it what's the use of rising your whole desktop to put it up on unix porn if some applications just don't respect all your hard work oh wait we already have libertvita for that now it's also true for mac and windows by the way it's not limited to linux a web app running locally will never look exactly like an application using the operating systems human interface guidelines or it will look almost perfect on one os and completely out of place on the others although just putting windows and human interface guidelines in the same sentence just doesn't feel right at all now of course that's not something that will bother everyone some people are fine with using apps that don't look or feel the same and that's okay too a bigger problem though is that while it's pretty easy to update the content of the app the website part of the application a lot of developers don't generally update the electron part of their application see when you create an electron app you have basically two code bases your web app and electron and both should be updated regularly because electron using chromium needs to be as up-to-date as any web browser you would use every day 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 so on wayland discord doesn't support screen sharing or when you use the flat pack version it doesn't support file portals so in the end you can't share your screen with other people and when you try to open a file to upload for example you will always get the gtk file picker even if you're on kde and that file picker can only see files that are accessible through the flat pack sandbox which means that unless you've given discord permission to access your whole home directory with something like flat seal you're not going to be able to upload anything at all this is problematic not only for security but also because it shows that while electron can have good cross-platform support you still can treat certain operating systems like third-class citizens and who's always the least well supported yep you guessed it it's us poor penguin fanboys we're not asking for much just update your freaking electron version it's not that hard and then there's the performance and resource usage since electron apps ship basically the whole of chromium's code base they aren't small discord for example once installed weighs more than 700 megabytes almost a gigabyte even the most basic of hello world applications would take about a hundred megabytes just to display a line of text the size usage is extremely high if you compare it with a native application and to think some people complained about the install size of flatbacks seriously look at electron stop fat shaming flatback start shaming electron apps now another example an application that does a lot more than discord users 109 megabytes when installed seven times less of all my apps only libreoffice uses more space 813 megabytes for the entire office suite discord uses the same disk space as an entire office suite and then there's the performance impact as well chromium isn't a lightweight browser at all each electron app you open loads an entire chromium instance in ram which can go up to 500 megabytes really fast discord again on my system with all its processes uses about 480 megabytes and that ram usage is the same whether the application is minimized to the tray or fully open when opening a new blank document uses 500 megabytes and libreoffice writer uses 150 megabytes of ram for a blank document this type of ram usage is just way too high and of course a new dram is wasted ram if it's not being used it's just sitting there doing nothing but if you fill it up with four electron apps you could have filled it up with eight more native applications so your computer is actively doing less but drawing more power this can add up very quickly it's probably not something you'll notice if you have 16 or 32 gigabytes of ram but if you have an older device with four to eight gigabytes then opening two or three electron apps will bring your computer to a crawl so you better make that swap file 20 or 30 gigs just to be sure electron is hated by a lot of people mainly because of this specific reason developers either assume users will run their app and their app only all that all users have really high-end systems with a lot of ram and cpu cycles it prevents good optimization because there's always that incompressible chromium part that you cannot control as a developer and that's not counting javascript's tendency to leak memory which can also add to a lot more ram usage in the end and still specifically for us linux users electron can be a boon because not many developers would develop their apps for linux using gtk or qt not many do but when supporting linux is just as easy as supporting windows or mac and doesn't really require any extra work then the end result is that we get applications on linux that we just wouldn't have had otherwise we wouldn't have discord or teams or vs code if electron or alternative solutions didn't exist these developers would never have taken the time to make a native linux app using gtk or qt and if they did people would complain about the choice of toolkit why didn't they pick my desktop of choice they probably got paid it's all a conspiracy i will always favor an application that uses gtk or qt over an electron app but i would also rather have access to many different applications than flat out refuse to use them because they are electron or because the developer didn't make a native application i see this along the same lines as wine and proton would you rather have only 10 percent of the steam library playable on linux because you could only use native linux builds or do you prefer having 73 of the top 100 games on steam that run thanks to proton and once the linux desktop has reached enough users and has grown thanks to having actual apps even if they're electron available then maybe developers start differentiating themselves by bringing real native applications for our platform in the end i understand both viewpoints why some developers love electron why some users hate it but personally even though i'm not a fan of electron apps i would rather have them available than not having any alternative available for this kind of use case and i'd rather end this video with this segue to today's sponsor tuxedo tuxedo is a company based in germany but they ship worldwide a whole range of linux laptops and desktops what do i mean with linux laptops and desktops well they're just devices that have linux pre-installed you can pick from a variety of popular distributions when you order your device or you can rest assured that you can install basically any other distro you want thanks to great hardware that supports linux natively and access to some repositories that tuxedo maintains and that lets you install any configuration that you might need for everything to run optimally they have a wide range of keyboard layouts and a wide range of devices that you can all configure to your heart's content with gpu options cpu options ram solid-state storage and even you can engrave your own graphic design on the lid which is amazing so if like me you're interested because i just bought that stellaris 15 in the back which is their high-end gaming laptop i use it to edit my videos if you're interested in such a device click the link in the description below and get yourself a new tuxedo laptop they're really good so thanks everyone for watching the video i hope you enjoyed it if you did don't hesitate to like to subscribe to turn on notifications to write a comment and if you didn't like it well you can also dislike it and tell me why in the comments as well although i doubt you actually reached this part of the video if you didn't enjoy yourself and if you have tons of cash lying around and you want to help me make more of these videos you can click on the super thanks button underneath the video or on the paypal link in the description or you can join my patreon members or my youtube members both get access to a weekly patreon cast and the right to vote on the next topics i'll cover so thanks everyone for watching and i guess you'll see me in the next one bye [Music] you
Info
Channel: The Linux Experiment
Views: 171,973
Rating: undefined out of 5
Keywords: linux, elementary os, open source, distribution, linux distro, linux help, linux tutorial, linux 2022, opensource, free software, linux tips, ubuntu, distro, developing with electron, why people don't like electron, why electron hate, electron bad, electron good, electron hated, electron is hated, electron is great, why use electron, stop using electron, how to use electron, using electron, electron how to, electron dev, electron JS, electron node JS, electron linux
Id: G1K0Mb-rLBU
Channel Id: undefined
Length: 17min 18sec (1038 seconds)
Published: Sat Jul 09 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.