News for hackers. Stuff that matters.
Re:Electron considered harmful by Ianvdl on Thursday November 24, 2016 @12:33PM (#13031497)
> 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 here seem to enjoy node.js).

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

I feel it's unreasonable to turn a single web page into a desktop app by bundling an entire web browser with it.

> ...because they can treat it like any other desktop application -- with hardware access, and subject to the OS' native task management.

If you need direct hardware access it probably isn't well-suited to being a web app in the first place? Why use web technologies for it then?

> For other apps, Electron allows the world's most popular layout system (HTML+CSS) to be used with one of the world's most popular programming languages. This is a huge boon for re-using knowledge, and perhaps does lead to some amateurish projects. Similar criticisms were leveled towards Visual Basic, where drag-and-drop composing and a good IDE enabled people to quickly crank out a GUI app from an idea.

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.

The resource bloat and (usually) extreme disparity with the native user interface rarely makes it worthwhile for me to use an electron app. It feels like forcing a square peg into a round hole because the developer is seemingly unwilling to consider more appropriate technologies outside of their comfort zone. Yes, there are well-made electron apps (like VS Code mentioned in the article), but I, personally, would hate for it to become the norm.

Re:Electron considered harmful by jeremiep on Thursday November 24, 2016 @12:59PM (#13031684)
> 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 completely disregards the fact that most people using these frameworks are bad developers to begin with.

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

> If you need direct hardware access it probably isn't well-suited to being a web app in the first place? Why use web technologies for it then?

What if the only difference between the web and desktop apps are that the desktop app can open local files while the web app downloads them? Are you going to write two apps in that case? This would be a mediocre economical choice at best as you're more than doubling the production costs for a difference nobody is going to care about.

Re:Electron considered harmful by santaclaus on Thursday November 24, 2016 @01:18PM (#13031812)
> 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 by jeremiep on Thursday November 24, 2016 @01:35PM (#13031932)
And they're all mediocre when compared to Vim/Emacs (and these are both inferior to Spacemacs which actually combines these two.)

Why isn't everyone using Spacemacs then?

Visual Studio is much, much slower than all of them yet its still an incredibly popular IDE for some reason. It has endless flaws, one of them being its still 32-bit and often crashes on larger projects. (The last game I ported to the PSVita would hang VS for minutes sometimes, often ending with out-of-memory errors, we'd reboot VS between every profiling session.)

For a good chunk of users, features and ease of use are more important than performance (especially when most of the time it really, really doesn't matter for an editor.)

Re:Electron considered harmful by rvern on Friday November 25, 2016 @01:32AM (#13034735)
People use Visual Studio instead of Vim or GNU Emacs because there's much more marketing and advertising being done for Visual Studio.
Re:Electron considered harmful by nilliams on Thursday November 24, 2016 @01:29PM (#13031884)
And yet they're still popular, so it can't be that significant of an issue.
Re:Electron considered harmful by jeremiep on Thursday November 24, 2016 @01:35PM (#13031944)
> Significant enough that it comes up anytime there is a discussion on HN.

Because people don't know any better, shun anything that isn't their pet technology and generally sit on the wrong end of the Dunning-kruger effect.

Re:Electron considered harmful by santaclaus on Thursday November 24, 2016 @01:34PM (#13031930)
Significant enough that it comes up anytime there is a discussion on HN.
Re:Electron considered harmful by nilliams on Thursday November 24, 2016 @01:37PM (#13031959)
> Significant enough that it comes up anytime there is a discussion on HN.

That is not a useful indicator. There's a reason that 'editor-wars' is a running joke.

Re:Electron considered harmful by akamaozu on Thursday November 24, 2016 @09:27PM (#13034035)
> What if the only difference between the web and desktop apps are that the desktop app can open local files while the web app downloads them?

This was the exact problem I needed to solve that led to my first Electron app.

Needed to recursively crawl a directory and generate a report on all pdfs found and the total pages in each pdf.

It seemed silly to learn a new language and ui kit when I could glue together some wen technology over a weekend and make it happen.

http://designbymobi.us/how-i-built-my-first-desktop-app-in-3...

Re:Electron considered harmful by FrancoDiaz on Thursday November 24, 2016 @12:42PM (#13031563)
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 refuse to to learn Qt or gtk+, unless there is some overwhelming benefit for me to learn it.

Re:Electron considered harmful by ng12 on Thursday November 24, 2016 @12:51PM (#13031631)
At this point it's like somebody saying "English is a terrible language". Yeah sure but what else are you going to use?
Re:Electron considered harmful by pluma on Thursday November 24, 2016 @01:23PM (#13031856)
Ugh, why can't everyone just speak a real language, like Korean. Agglutinative languages are where it's at.
Re:Electron considered harmful by Ianvdl on Thursday November 24, 2016 @12:54PM (#13031640)
> I can never see the point of comments like these. Not one person who reads that will have his mind changed.

I wasn't expecting to change anyone's mind with that. There are more robust programming languages that don't have the same inconsistencies and idiosyncrasies and encourages better practices in general (even though it is true than you can write terrible code in any language).

> 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 refuse to to learn Qt or gtk+, unless there is some overwhelming benefit for me to learn it.

That is true, but consider that the end product is not necessarily meant to be most convenient for the developer. Keeping the user in mind when making these decisions may make you consider more native and less resource-intensive alternatives. I have read in the past that Electron also posed some difficulties for screen readers, for example (although I'm not sure if that is still the case), which might not be something that impacts you as the developer, but which can make it harder for someone to make use of your software.

Re:Electron considered harmful by jeremiep on Thursday November 24, 2016 @01:09PM (#13031735)
This means absolutely nothing. Otherwise everyone would be using Haskell, Coq or Agda. I'm willing to bet your favorite language has an insane amount of flaws as well (hint - they ALL do, otherwise we'd have converged to the "one true language" as an industry long, long ago.)

You can make an argument to say C++ is terrible, Java is, Ruby is, Python is, and it means absolutely nothing other than showing of your own insecurities. You can build great and mediocre things in any language and any platform. People do every day.

Also, if the developer is not one of the users of the software, you've already thrown a good chunk of quality out the window right there. You're simply not going to have the vision required to build the optimal user experience.

Re:Electron considered harmful by chr1 on Thursday November 24, 2016 @06:58PM (#13033570)
> Keeping the user in mind when making these decisions may make you consider more native and less resource-intensive alternatives

Usually the choice for the user is between "have an electron app in a month" and "have native app in a year", most users prefer to not wait, and when native app comes in a year, electron app will have much more polish, and run acceptably on new hardware.

The issue is not about 'protecting poor users'.

Most electron apps are quick experiments, to test out an idea without spending too much resources on it.

If idea is great, and performance is an issue, and there are enough users to get a team of highly skilled developers to work on it, they'll create native app, replace electron version (and then embed js vm to support plugins:).

Re:Electron considered harmful by always_good on Thursday November 24, 2016 @01:26PM (#13031872)

    > but consider that the end product is not
    > necessarily meant to be most convenient
    > for the developer.
Sorry, but life isn't fair. Everything including software involves trade-offs, and perhaps ones that you would not have made yourself.

For that reason, your post along with the blog post comes off as a tantrum. And if users really cared about these things, then surely you'd be able to swoop in and capitalize on it. But we both know that's not happening.

Re:Electron considered harmful by ethbro on Thursday November 24, 2016 @12:59PM (#13031683)
>> 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.

Re:Electron considered harmful by pluma on Thursday November 24, 2016 @01:22PM (#13031841)
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 by marcosdumay on Thursday November 24, 2016 @02:16PM (#13032185)
First, X-only programmers are obviously wrong, whatever is the value of X.

That said, yes, somebody ought to love JS in a not blind way. Big numbers work that way. If that's you, I don't think those comments are for you. All languages have different flaws, every flaw relevance varies by context, and contexts are incredibly subjective. Yet, some contexts are much more common than others, and many people preach in support languages that are harming them because they don't know any better.

Re:Electron considered harmful by k__ on Thursday November 24, 2016 @03:06PM (#13032451)
I did C, C++, Java, PHP, VBA and JS and can't tell why so many people have constant beef with JS. I mean especially after all major platforms have adopted ES2015.
Re:Electron considered harmful by marcosdumay on Friday November 25, 2016 @05:24AM (#13035657)
For me, IO in JS is still kind of a hack. It still imposes an structure on my code that is different from the one I want.
Re:Electron considered harmful by pluma on Friday November 25, 2016 @09:23AM (#13036881)
IO in what? The browser? Node? If you mean node, what IO specifically? `http.createServer`? `fs.readFileSync`? `fs.createReadStream`? `fs.open`? `fs.readFile` with node callbacks? Promises? Streams? Observables?

Without context it sounds like you saw a bunch of nested callbacks in a Node.js example and judge the entire language based on that.

Re:Electron considered harmful by pluma on Friday November 25, 2016 @09:29AM (#13036919)
You'd be surprised how many people I've met that enjoy JavaScript. Nearly everyone I've met that hates JavaScript either didn't bother to learn it ("It's just a scripting language") or is just upset that they can't use their favourite programming language all the time (this is how we ended up with CoffeeScript, Sass and Haml and why everything in the Java world is eventually wrapped in XML).

I've seen enough different use cases and teams and programming languages to understand there's no point in being arrogant about language choice: if a team already knows a given language, it is most likely the right tool for the task, unless the benefits of replacing it are worth the overhead of properly switching to and gaining competence in another language.

Re:Electron considered harmful by tlrobinson on Thursday November 24, 2016 @12:58PM (#13031674)
> 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 more popular than "not terrible" languages like ClojureScript, Elm, etc.

1. https://github.com/jashkenas/coffeescript/wiki/list-of-langu...

Re:Electron considered harmful by to3m on Thursday November 24, 2016 @01:17PM (#13031806)
"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 by tlrobinson on Thursday November 24, 2016 @01:25PM (#13031864)
Are you suggesting all dynamically typed languages are "terrible"?
Re:Electron considered harmful by marcosdumay on Thursday November 24, 2016 @02:18PM (#13032194)
The only languages I can think that share those properties are Perl (5, don't know about 6) and the retired Visual Basic.

There is more there than dynamic typing.

Re:Electron considered harmful by tlrobinson on Thursday November 24, 2016 @03:03PM (#13032427)
Not sure what I'm missing. Ruby? Python?
Re:Electron considered harmful by marcosdumay on Friday November 25, 2016 @05:22AM (#13035648)
You are missing this part: nor are types associated with properties.

Ruby and Python do not fit it.

Re:Electron considered harmful by tlrobinson on Friday November 25, 2016 @06:51AM (#13036060)
You can assign values of different types to the same property in those languages, no?
Re:Electron considered harmful by marcosdumay on Monday November 28, 2016 @07:42AM (#13055028)
Types dictate¹ what properties are available.

1 - Or, in the case of Python, mostly dictate.

Re:Electron considered harmful by errantspark on Thursday November 24, 2016 @01:29PM (#13031893)
Cute. Smalltalk and LISP are terrible too huh?
Re:Electron considered harmful by to3m on Thursday November 24, 2016 @01:53PM (#13032066)
Lisp is marginally better, because it tries less hard to work around type mismatches (so something like (+ 1 "") is an error). But it suffers from the same fundamental problem: no type checks until runtime.

It's fine to have some kind of option for data whose type isn't known until runtime. This stuff happens, and languages that insist there's no such thing make dealing with it more difficult. But this is the rarer case! Why optimise for it rather than for the more common one?

Re:Electron considered harmful by kazinator on Thursday November 24, 2016 @02:51PM (#13032361)
What Lisp are you developing with? Mature "industrial strength" Lisp compilers do perform type checks prior to run time.

Dynamic typing isn't optimization; dynamic typing without any static analysis is the utter lack of optimization.

Re:Electron considered harmful by always_good on Thursday November 24, 2016 @01:09PM (#13031742)

    > It feels like forcing a square peg into a round hole because the 
    > developer is seemingly unwilling to consider more appropriate
    > technologies outside of their comfort zone
Until I find out I'm immortal, the "right tool" is typically the one that lets me launch the fastest.

It just makes you feel good to dismiss other people as lazy or unwilling to venture outside their comfort zone, but that's more of a revelation about how you view others.

Re:Electron considered harmful by gotofritz on Thursday November 24, 2016 @06:31PM (#13033445)
> JS is a terrible programming language

oh do us a favour, that's just YOUR opinion