Live data from Hacker News

Electron considered harmful

drewdevault.com

31–40 of 256 posts

Re: Electron considered harmful

#31
I have been wondering...does Slack freeze for like a couple of minutes a couple of days a day for someone else?

I am on win10, on pretty hefty machines. No idea if it's because Electron or something else, but it's really annoying. I could not find any trace of issues in the event viewer etc.

Re: Electron considered harmful

#32

I look at Electron apps the same way I used to look at Adobe Air apps. Any League of Legends player knows how bad the launcher is - 80% the fault of Adobe Air. Sure it was easier to build, but your users suffer for it. Electron apps are pretty terrible performance wise, and you can immediately tell it's an Electron app. - Atom - Slack - GitKraken All of these apps have 'tells'.

While I agree with you that the old League launcher was just trash, I am mildly impressed how long it has lasted and worked for Riot. As much fun as it is to make fun of Riot's spaghetti code, they did a decent job with the Air Client, far more than I would have expected before I knew it was Air.

Re: Electron considered harmful

#33
post #3

This had me for the first half, where the author walks you through the 'case study' applications that offer minimal functionality despite shipping with an entire browser inside. But then the essay turns into a rant. It's 2016, people, the ship has sailed on pretending JS isn't a real programming language. Phrasing the argument the way he does just betrays his smug elitism. The fact is, for many types of applications,…

Essays like these, along with Thanksgiving conversations with older extended family, are what really make me question the wisdom of eternal life. What if all the people stuck in the past like this were with us forever?

Re: Electron considered harmful

#34
post #16

I think the points raised are solid, but at this point it seems like Electron is the best worst solution for cross platform UI. Having worked with Qt I never wanna do that again. There's also a much more significant portion of developers who can work on Electron based apps. Part of picking the best tool for the job involves considering maintainability and ease of development after all.

> Having worked with Qt I never wanna do that again.

I've had to work on PyQt5 at work, and was pleasantly surprised out how easy it was to hack up a full app.

Re: Electron considered harmful

#35
> For the love of God, learn something else. Learn how to use GTK or Qt. Maybe Xwt is more up your alley. How about GNOME’s Vala thing? Learn another programming language. Learn Python or C/C++ or C#.

All of this takes time. If you want to launch an app on multiple platforms, Electron is a very time efficient way to do this. Obviously native apps for every platform would be ideal but not everyone has the resources for that.

> Let me be clear about this: JavaScript sucks. It’s not the worst, but it’s also not by any means good. ES6 is a really great step forward and I’m thrilled about how much easier it’s going to be to write JavaScript, but it’s still JavaScript underneath the syntactic sugar.

Use something like Typescript or Flow then. The above is like saying C++ sucks because assembly is a bad language to code in.

Re: Electron considered harmful

#36

If electron apps had a smarter way to manage chrome core as a dependency, the file size would be peanuts. Every apps is download on the same bundled core. Once this happens you won't have 100mb sizes. An intelligent installer could check core, if not installed download and install otherwise use what's on the system.

What if there was a centralized way of accessing HTML + CSS + JS applications? Instead of installing apps, you could just... "download" the necessary files to execute them? Perhaps even on demand from centralized.. "servers"?

I really don't want APIs to freely access the filesystem, other processes etc in my browser. And my applications to work offline.

I haven't seen many examples of people using Electron to make applications that really should be web apps instead, but more for packaging web apps with native enhancements. Often I'd prefer a "proper" native app, pushing even more features in the browser IHMO is not the answer.

Re: Electron considered harmful

#37

If electron apps had a smarter way to manage chrome core as a dependency, the file size would be peanuts. Every apps is download on the same bundled core. Once this happens you won't have 100mb sizes. An intelligent installer could check core, if not installed download and install otherwise use what's on the system.

What if there was a centralized way of accessing HTML + CSS + JS applications? Instead of installing apps, you could just... "download" the necessary files to execute them? Perhaps even on demand from centralized.. "servers"?

> What if there was a centralized way of accessing HTML + CSS + JS applications

There is. The major OSs provide APIs to access the platform browser. The downside is you need a platform specific shim to set this up using native code. So, developers need to step outside of their JS worldview for a few days to avoid that 200mb app size penalty.

If you are building a platform agnostic app then I understand the value of Electron to avoid that work across each platform. But, it seems several of those Electron apps aren't even platform agnostic, so why not build the platform specific shim and be a better citizen on my hardware.

edit: I'm daft

Re: Electron considered harmful

#38

If electron apps had a smarter way to manage chrome core as a dependency, the file size would be peanuts. Every apps is download on the same bundled core. Once this happens you won't have 100mb sizes. An intelligent installer could check core, if not installed download and install otherwise use what's on the system.

For YEARS I remember having to chase down the VBRUN{100|200|300}.dll runtimes for the Visual Basic runtimes.

Now that internet is everywhere, couldn't Electron:

1) Setup a common bootstrap mechanism so it's version agnostic 2) Check for the declared version of the app 3) If online (and allowed by system policy) check if there are security issues, or updates for the needed version 4) Advise user where to download the update, or (again, if allowed by policy) allow the user the proceed with the installation?

With some magic to allow a 'side-by-side' distribution of the Electron runtime, on good-ol' durable media, wouldn't this go far to minimize the size of the distributions of these Electron apps? You could have a system with one (or more if nessecary) versions of the runtime, and multiple apps using that runtime (with isolated profiles, of course ...)

Re: Electron considered harmful

#39
"If you want to make a quick little app, instead of using something convenient that you know, you should learn a REAL language like C"

Why is this garbage on the front page? Stop giving condescending people like this a platform.

Re: Electron considered harmful

#40
post #4

See, I totally agree with this essay. But what are the alternatives? Getting started with Qt/GTK isn't nearly as easy, for example. Maybe someone should write an intro to native GUI programming for JS devs.

Getting started with Qt is pretty easy I'd say, at least when you use Python and not C++:

   import sys
   from PyQt4 import QtGui

   def window():
      app = QtGui.QApplication(sys.argv)
      w = QtGui.QWidget()
      b = QtGui.QLabel(w)
      b.setText("Hello World!")
      w.setGeometry(100,100,200,50)
      b.move(50,20)
      w.setWindowTitle(“PyQt”)
      w.show()
      sys.exit(app.exec_())
       
   if __name__ == '__main__':
      window()
In general I think Qt is one of the best-documented UI toolkits out there, and while it surely is complex it offers a lot of modern features and is able to produce pretty great UIs.
Post reply on HN