Live data from Hacker News

Electron considered harmful

drewdevault.com

101–110 of 256 posts

Re: Electron considered harmful

#101
I recently had to decide on a GUI technology for a file manager I'm developing [1]. Electron is sexy, but unfortunately takes way too long to start for my purposes. I ended up with PyQt:

Pros:

+ Fast startup speed

+ I can use Python (and its vast ecosystem)

+ Qt has good ready-made components for eg. displaying a list of files (which is exactly what I need)

Cons:

- Compiling Qt (which I have to do for various reasons) takes time and is a pain

- Bundling and deploying a Qt-based app (times 3 - OS X, Windows, Linux) is a pain

- I have to deal with auto-updating myself (which I believe Electron supports out of the box) - times 3.

- I would prefer to lay out the UI in well-understood HTML/CSS. Qt's components and its CSS-equivalent behave in very weird ways sometimes.

I still sometimes wish I could use Electron but as OP says, we're supposed to pick the right tools.

I explain my reasoning for picking PyQt over Electron (and other alternatives) in a blog post [2].

1: https://fman.io

2: https://fman.io/blog/picking-technologies-for-a-desktop-app-...

Re: Electron considered harmful

#102

sigh First off, JS is a perfectly usable language. In some respects, it's even great: of the "big three" scripting languages (Python/Ruby/JS), it's the only one that got Lambdas right, and also got closures right (unlike, say, Python). It has sometimes-quirky syntax, and some odd semantics, but they don't bite as often as you'd think. Second off, I would say that this article is right about the bulk of Electron: It's…

Now I'm curious. What would you say is wrong with python closures? Asking because they feel natural to me, and I haven't run into anything irritating about them. (As opposed to lambdas, which are really annoying and restricted in Python.)

Re: Electron considered harmful

#104
post #30

Earlier quoted context omitted.

> 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. Using the date as an argument is also poor form. JS is a terrible programming language (I'm not denying that it is a programming language though) regardless of how popular it is (although I think I might be going against the grain here on HN, many people her…

> JS is a terrible programming language [Citation needed] Sorry, JavaScript may have gotten lucky being the lingua franca of the web, and it might not be perfect or even great, but it's "good enough" for most purposes these days. If it were "terrible" you would expect at least one compile-to-JS [1] to have gained a non-trivial amount of traction by now. The supersets of JavaScript like Babel, TypeScript, and Flow are…

"a variable is not required to have its type declared nor are types associated with properties" (ECMAScript 2016 spec, 4.2)

Re: Electron considered harmful

#105
post #30

Earlier quoted context omitted.

> 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. Using the date as an argument is also poor form. JS is a terrible programming language (I'm not denying that it is a programming language though) regardless of how popular it is (although I think I might be going against the grain here on HN, many people her…

> the developer is seemingly unwilling to consider more appropriate technologies outside of their comfort zone The very same can be said about people looking down on Electron. Most of them can't write decent native apps to begin with. I used all of win32, Qt, GTK, wx and Cocoa to name but a few. They all suck in one way or another. Suggesting people are poor native developers for refusing to learn these frameworks co…

> For the average application going native will easily triple your development time and costs for absolutely no noticeable performance difference.

Sublime text still smokes Atom and VSCode in the performance arena.

Re: Electron considered harmful

#106
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,…

   "Electron is a really good fit: for example, shipping a
    single-page webapp as a desktop app, a need that
    surfaces often in today's world, despite his derision
    of this concept."
From a systems perspective that is emminently rant worthy, it indicates the system has completely failed the developer who cannot easily express what they can in a single page web app as a real application in the system.

Re: Electron considered harmful

#107

sigh First off, JS is a perfectly usable language. In some respects, it's even great: of the "big three" scripting languages (Python/Ruby/JS), it's the only one that got Lambdas right, and also got closures right (unlike, say, Python). It has sometimes-quirky syntax, and some odd semantics, but they don't bite as often as you'd think. Second off, I would say that this article is right about the bulk of Electron: It's…

Now I'm curious. What would you say is wrong with python closures? Asking because they feel natural to me, and I haven't run into anything irritating about them. (As opposed to lambdas, which are really annoying and restricted in Python.)

It's not as bad as I thought, but Python doesn't actually have lexical scope, not really. But the LEGB rules mean that it should still work as you expect.

Re: Electron considered harmful

#108
post #79

Earlier quoted context omitted.

JS is a terrible programming language I can never see the point of comments like these. Not one person who reads that will have his mind changed. HTML/CSS can be nice to have in such a situation, although a refusal to learn other GUI frameworks probably makes for a poor (native) developer. No it doesn't. Either the developer benefits or doesn't benefit from "refusing". There's only so much time in the day. I'll refus…

>> JS is a terrible programming language > I can never see the point of comments like these. At minimum, I think the hope is that js-only programmers become aware that there are alternatives. And hear that the people who use those alternatives often find them better.

The arrogance in it, though, is that because people who like JS are "obviously" wrong, the reason must be that they don't know (enough) other programming languages or don't know them well enough.

I have used a number of different programming languages before JS, a couple of them more extensively and for a longer time than JS. I like JS. I understand its flaws. I also understand that all programming languages are terrible in their own unique ways -- I have accepted JavaScript's terribleness and a lot of it is addressed by ES2015 and beyond. I prefer JS's terribleness over that of other languages.

I like to make fun of PHP programmers the same way, but I understand that there are PHP programmers who are able to see beauty in PHP or have found their own perspective of PHP which makes it less terrible than the alternatives. I'm not one of them but I can relate to them. It's called empathy. OP lacks it.

Re: Electron considered harmful

#109
Web browsers should have integrated functionality to run some websites as standalone apps (anyone remember Prism?). That way we wouldn't need to install yet another copy of browser with each app.

Re: Electron considered harmful

#110

Earlier quoted context omitted.

>Electron allows the world's most popular layout system (HTML+CSS) to be used with one of the world's most popular programming languages Just wanted to name the most obvious alternative: embedded browser component like QtWebKit, which allows to code most of the application logic on the language of your choice. Embedded browsers are the way people have been doing it since circa 2000 (by then, Windows was dominating pl…

But then you can't share the same code between your web application and desktop application. As a company you would have to pay two separate teams to develop each - developer time is expensive. Yes - electron apps are slower and eat more ram - but someone else is paying for that.

Should you be sharing that code? Should there be any business logic in the UI, or should it be pushed back into services that can be shared across both?
Post reply on HN