Slashdot Mirror


In Defense of the Popular Framework Electron (dev.to)

Electron, a popular framework that allows developers to write code once and seamlessly deploy it across multiple platforms, has been a topic of conversation lately among developers and users alike. Many have criticised Electron-powered apps to be "too memory intensive." A developer, who admittedly uses a high-end computer, shares his perspective: 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. [...] 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. [...] 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.

14 of 138 comments (clear)

  1. "too memory intensive."? by kbdd · · Score: 4, Informative

    I had never heard of it so I googled it.
    Oh, a new text editor, maybe I can use it. Click on the download link.
    163MB for a text editor, ouch!
    I do not know about RAM usage but that thing is already a hog on my hard drive...

    1. Re: "too memory intensive."? by vlueboy · · Score: 4, Informative

      20th century called. They want their computer back.

      Get real. Not everyone is on the desktop world. Every MB counts. Your $400 retail computer comes with 1 Terabyte now, but most home users out there only replace their 10 year old machines when death is imminent, and they have more humble 300-500GB setups.

      Laptops and SSD drives bring another dimension to the situation. SSDs are laughably small even on desktop PCs. The "new" professional grade HP laptop that work assigned me a year ago was a downgrade from the regular HD in the 6-year old it was replacing where I had at least 300GB.

      The formatted SSD 100GB started out losing 30GB from my files transfered from the old PC (I had a couple virtual machines and respective linux ISOs because shells and SSH on Windows is deficient, even with Cygwin)

      Another 20GB was occupied by Windows 7 and I ended with about 10GB free, which was a bit of a worry preceding the Windows 10 download / upgrade process.
      Every megabyte counts, especially when you now automatically have programs doubling in size.

  2. Re:So Popular that you need to explain it. by davecb · · Score: 4, Interesting

    Atom is vaguely OK, but I wouldn't care to try to maintain js, but Slack is like being trapped in a large echoing room filled with people madly shouting "ooh, shiney!"

    It also dragged my 32 GB dev server into the weeds, so I probbaly agree with the criticisms of Electron proper.

    --
    davecb@spamcop.net
  3. Popular? Yes, with shitty hipster startups! by Kaptain+Capslock · · Score: 5, Insightful

    Let's face the truth: Electron delivers a Chromium engine, Node.JS and V8, all rolled into one package to you. So of course it's a memory hog, depending on what you are going to program, like a terminal, clipboard manager or tiny frontend to FFMPEG [all existant projects]. All those programs alone need 200 MB for the runtime engine, to just do really simple stuff.

    It also needed 13% of CPU time to just draw a blinking cursor (!).

    It's mostly used by shitty webhipster design startups, which are just way too lazy to learn a proper programming language, and it even doesn't fit well with the UI of your operating system. And since the underlying parts of it, when a program gets delivered, aren't for sure update as frequently as Chromium alone, it's a security nightmare as well.

    1. Re:Popular? Yes, with shitty hipster startups! by tepples · · Score: 3, Insightful

      You can run Android apps in various ways on a laptop, so scratch the need for the Android tablet.

      To which "ways" do you refer? I'm aware of two:

      Android in a VM Running an x86 or x86-64 build of Android Open Source Project in a virtual machine on a PC might be fine for apps available as a loose APK, through Amazon Appstore, or through F-Droid. So might BlueStacks App Player, which I'm told actually emulates an Android device's ARM CPU. But it doesn't work for Android apps that are exclusive to Google Play Store or rely on Google Play Services. Android apps on Chromebook Google Chrome on recent Chromebook laptops can run Android apps from Google Play Store. So that technically counts as Android apps on a laptop. The corresponding feature in Google Chrome for Windows, macOS, or X11/Linux is called ARC Welder, but a review says it's glitchy and lacks Google Play on other than Chrome OS. This which is why I mentioned having to carry a Chromebook to make use of this feature.

      There are few applications on FreeBSD you can't compile for Linux

      Which is where the RAM upgrade comes in. In order to run Windows, FreeBSD, or GNU/Linux in a virtual machine in macOS on a MacBook, you may need more RAM than Apple includes with the base model. But mostly I'm referring to apps for X11/POSIX that work on FreeBSD and GNU/Linux but haven't been ported to Win32 or Cocoa. Perhaps one possibility is to install Xcode, Homebrew, and an X server, and buy a second Mac for the maintainer of each app you're trying to build and use under Homebrew so that he can investigate the issues that you file in the issue tracker.

      possibly a Windows VM if the Windows application doesn't work under Wine.

      Which again is where the RAM upgrade comes in, along with the Windows license.

    2. Re:Popular? Yes, with shitty hipster startups! by JohnFen · · Score: 3, Informative

      Sure, if I need some software and literally the only thing available sucks, then I'll use it anyway.

      But, in practice, it's extremely rare that you can't find a natively compiled version of what you need.

      But none of that changes the fact that applications built with frameworks tend to suck, and the effort required to make them not suck negates much of the advantage of using frameworks.

  4. I hate electron apps... by Junta · · Score: 4, Insightful

    So far my experience has been atom and mattermost desktop.

    For atom, everyone was swearing*so hard* about how good an editor it is, and it's frankly not that good, a resource hog, and just generally a bit glitchy around the edges. Slow to start. Sure it's 'extensible', but the extensions have thus far for me been extremely ill-fitting and low quality. It reminds me of the 'plugin' fad of the late 90s/early 2000s when a lot of applications pretended to be incredibly extensible but really it was just providing clunky entry points to pretty much standalone apps.

    For mattermost, it was basically loading the web gui in an app.... no value over the 'normal' web gui. For atom at least you have the excuse you are dealing with offline material so a 'normal' browser hosted approach doesn't fit, but in mattermost you are connecting to a server anyway. I might have found other reasons to be dissatisfied, but the complete lack of benefit over the browser version just made my interest evaporate.

    I don't understand the fascination with using the web development trappings when you don't have to. It's one of the most tedious approaches to application development.

    --
    XML is like violence. If it doesn't solve the problem, use more.
    1. Re:I hate electron apps... by ItsJustAPseudonym · · Score: 3, Insightful

      I don't understand the fascination with using the web development trappings when you don't have to.

      Maybe "when all you have is a hammer, everything looks like a nail"?

      People need to get out of the rut of web development.

  5. Extreme ignorance on the part of web "programmers" by Anonymous Coward · · Score: 3, Interesting

    I don't understand the fascination with using the web development trappings when you don't have to. It's one of the most tedious approaches to application development.

    It pretty much just boils down to ignorance. There are a lot of "programmers" (I use that term very reluctantly) who only know JavaScript, HTML and CSS. Only a fraction of them know PHP or Ruby on Rails. That's as deep and as wide as their knowledge and experience goes.

    They don't know C. They don't know C++. They don't know Java. They don't know C#. They don't know anything other than web development.

    Being so ignorant, they don't realize just how awful their preferred technologies really are. They also don't realize how much better the alternatives can be.

    So what do they do? They write absolutely everything in the only language they know: JavaScript. They build their applications (or their half-arsed attempts at applications) using the closest thing to a UI framework that they know: HTML and CSS. And the results are disastrous.

    We see the same thing happen with databases. People who know nothing about SQL or relational theory find that they need to store data, and instead of using a real database, they choose some shitty NoSQL database instead.

    The worst part of all of this is that these people refuse to learn how to use real technologies. They're so ignorant that they're unwilling to look beyond what they know. So this problem just gets worse and worse. They try to write more and more software using JavaScript, HTML and CSS, and the end result is that we see more and more extraordinarily bloated and slow applications.

  6. It's Chrome by dabadab · · Score: 3, Informative

    Electron is basically Chromium.
    There are a few extras here and there but in the end an Electron application is some html, css and javascript code packed together with a browser - so it's not that suprising that it eats up ram just like Chrome.

    --
    Real life is overrated.
  7. It's not 'a framework'. It's Chrome. by jpop32 · · Score: 4, Insightful

    Seriously. 'Framework' part is just a wrapper around a whole, full fledged Chrome browser. And there's your problem. If you have Atom, Slack and any other Electron app, along with your 'regular' Chrome, you have *four* copies of Chrome on your computer. If you think that is silly, yes. It is.

    Which is why it's crazy to run any Electron app that is available on the web. Run Slack in Chrome, pin the tab, enable notifications and that's it. Identical, and one less Chrome installation.

  8. Re:16gb is not imminent by Zaelath · · Score: 4, Insightful

    [thing] which uses a LOT of [constrained resource] works just fine on my [device] which has [unusually large amount of constrained resource], maybe your [device] is too old? - Said every fucking developer ever.

    Followed by; "What do you mean lag makes the game unplayable? It works just FINE on my LAN, asshole!".

  9. Re:C++ has more of an installation approval barrie by JohnFen · · Score: 3, Insightful

    has run into political problems getting corporate, school, and public library IT departments to permit installation of applications

    Yes, if you're aiming your software for specialized environments then you have to adapt to what the environment requires.

    most end users have shown themselves unwilling to download C++ source code and learn how to compile it

    If you're requiring users to compile the code themselves, you're doing it wrong. The least you can do is actually produce a build for the operating systems you support.

  10. Who Speaks For The Users? by Anonymous Coward · · Score: 4, Insightful

    "...as a new company without a lot of resources, this setup has just barely allowed us to enter the marketplace."

    OK, so you've solved your problem as a startup. And you did acknowledge the user, barely.

    "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."

    And then you let us know what your priorities are. The users can pound sand, you're a Startup dammit! And you have Needs! All your users need to upgrade to High End Equipment for the privilege of using your indispensable App!!

    You might want to rethink your priorities, before your precious startup collapses due to market disinterest in your bloated POS. Maybe Facebook can get away with that attitude, and maybe Twitter. You cannot.