News for hackers. Stuff that matters.
Re:Electron is flash for the desktop (2016) by AboutTheWhisles on Wednesday February 13, 2019 @01:05PM (#19155078)
No it isn't, flash was the best way to do many things for the years it was popular. Video, vector animation, simple interactivity.

Electron is only the best way to do something when someone knows only javascript and web dev but doesn't want to learn a new language. Maybe a case could be made for severe misconceptions also helping electron like 'a custom native app has to be made for each platform', even though C++ and Qt and many other combinations can be written once with 99% of the source being the same for every platform.

Re:Electron is flash for the desktop (2016) by SquareWheel on Wednesday February 13, 2019 @01:19PM (#19155263)
>Electron is only the best way to do something when someone knows only javascript and web dev but doesn't want to learn a new language.

Why is there always someone ready to jump in with this elitist nonsense? There's plenty of reasons to use a web stack even if you know other languages. It's inherently crossplatform, has an extensive library, and is extremely quick to iterate on.

Slack and Discord building in Electron means they only need to maintain one codebase across web, desktop, and mobile. They don't need separate teams for building in Java, Swift, and C#. They only need to write a new feature once. Crazy, right?

This "web programmers are dumb" attitude is nothing but elitist rhetoric. Cut it out.

Re:Electron is flash for the desktop (2016) by sixstringtheory on Wednesday February 13, 2019 @01:50PM (#19155567)
I keep seeing this "extremely quick to iterate on" point being brought up in defense of Electron. Slack released threads 2 years ago and we still can't post snippets, images, or use many slash commands inside them. Their last genuinely new features in the last year were synced DM drafts and the little lock badge on workspaces you're signed out of. Where's the iteration?

Meanwhile, almost daily I hit so many issues with the macOS application that I have to walk away from my computer in frustration. It makes my working life miserable due to its poor performance and bugs, and it encourages awful organizational and communication habits.

Re:Electron is flash for the desktop (2016) by SquareWheel on Wednesday February 13, 2019 @04:20PM (#19157131)
It's a bit anecdotal, but I imagine Slack is being careful because they are targeting businesses. Discord is a similar platform which iterates new features extremely quickly.
Re:Electron is flash for the desktop (2016) by asdff on Wednesday February 13, 2019 @06:13PM (#19158077)
If that is the case, Slack should want to maximize features, even to the point of excess redundancy, so users can tailor their business product to the specific needs of their business. People don't work productively being boxed into one way of doing something, people work best if they are free to find their own ideal way of doing that thing or are able to tailor the product to the unique tasks they work on.

Think of all the different code editors developers use. Some are straightforward, some have a steep learning curve, yet the good ones are good because users can customize them toward their own personal preferences.

Re:Electron is flash for the desktop (2016) by derefr on Wednesday February 13, 2019 @01:37PM (#19155439)
> There's plenty of reasons to use a web stack even if you know other languages. It's inherently crossplatform, has an extensive library, and is extremely quick to iterate on.

The GP's point was that, in the year 2019, none of these features are unique to the web.

• For "frameworks", there's Silverlight, Adobe Air, Haxe, and—strangely enough—Flash itself, which still works just fine if your goal is to ship a standalone "projector" app rather than something that runs in a browser.

• Or you can use a cross-platform scripting language (e.g. Python) with a cross-platform GUI toolkit (e.g. QT, WxWidgets.)

• Or you can use a not-cross-platform language (e.g. C#) but just use the (pretty large) subset of that language that is compatible with a third-party cross-platform runtime (e.g. Mono). Before you laugh, this is exactly how many companies code games to be cross-platform: they just write them for Win32 but constantly test them under Wine to ensure they aren't breaking Wine compatibility. Then they ship one native version and two virtualization-layer-wrapped versions.

• Or—horror of horrors—you can just use Java, and use the various Java-to-native-X compilers to target mobile platforms like iOS. (It worked well enough for Minecraft!)

Re:Electron is flash for the desktop (2016) by Pfhreak on Wednesday February 13, 2019 @01:43PM (#19155512)
> none of these features are unique to the web.

The web has all of them, I have yet to find another platform/language that meets all the same criteria.

Combine all of the above with a rich toolchain and extreme dev tools portability -- I can be up and running on basically any machine in minutes. As well as ease of deployment (at least for hobby projects).

All of those other platforms are, for me, less in one of the axes I care about. I've developed extensively in Python, C#, and Java for both personal and professional projects and while I like developing in them for many, many reasons, when I need to start a new project I nearly always find myself reaching for Javascript as the starting point.

Re:Electron is flash for the desktop (2016) by SquareWheel on Wednesday February 13, 2019 @04:26PM (#19157202)
>For "frameworks", there's Silverlight, Adobe Air, Haxe, and—strangely enough—Flash itself...

With the exception of Haxe (and maybe Air), these are all dead or dying technologies.

Options 2 (Python/QT) works great, but is certainly more development hours and still requires platform-specific code.

>It worked well enough for Minecraft!

Minecraft was rewritten in C++ for mobile. It doesn't use Java.

Re:Electron is flash for the desktop (2016) by tyteen4a03 on Thursday February 14, 2019 @06:13PM (#19167003)
Minecraft (Bedrock, the engine used by Android, iOS and modern console versions) is written in C++ with custom renderers for different platforms it target. They don't compile their Java code to native code.
Re:Electron is flash for the desktop (2016) by saagarjha on Wednesday February 13, 2019 @02:01PM (#19155668)
> Slack and Discord building in Electron means they only need to maintain one codebase across web, desktop, and mobile. They don't need separate teams for building in Java, Swift, and C#.

Did you know that Slack has native iOS and Android apps, as well as a cross-platform C++ "LibSlack" run by another separate team?

Re:Electron is flash for the desktop (2016) by SquareWheel on Wednesday February 13, 2019 @04:29PM (#19157223)
I didn't. Are you saying they're not simple containers?
Re:Electron is flash for the desktop (2016) by saagarjha on Thursday February 14, 2019 @04:21AM (#19160664)
Not quite sure what you mean by "simple containers", but yes, they're native apps written in Objective-C and Java IIRC. And here's some more information on LibSlack: https://slack.engineering/libslack-the-c-library-at-the-foun...
Re:Electron is flash for the desktop (2016) by nv-vn on Wednesday February 13, 2019 @01:34PM (#19155405)
Qt is also cross-platform, easy to use, and has a giant library to work with. You can use it with virtually any language you want. Plus it runs on mobile.
Re:Electron is flash for the desktop (2016) by wesammikhail on Wednesday February 13, 2019 @01:38PM (#19155448)
and lets not forget, it looks like this:

https://doc.qt.io/qt-5/qtwidgets-mainwindows-application-exa...

You didn´t really counter the parent´s post with an argument. You just pretended to do so by suggesting an alternative that is incompatible with the requirements he had in mind because you think you know better...

Re:Electron is flash for the desktop (2016) by nv-vn on Wednesday February 13, 2019 @02:37PM (#19156080)
Qt is really trivial to style. That's like showing a blank HTML page without any CSS and discounting HTML because of that default appearance.
Re:Electron is flash for the desktop (2016) by ahartmetz on Wednesday February 13, 2019 @02:18PM (#19155839)
"It looks like this"

That just shows how little you know. One style in one configuration looks like that.

Re:Electron is flash for the desktop (2016) by pjmlp on Wednesday February 13, 2019 @05:05PM (#19157558)
Yep, when all that one has is programmer art.

Doing web apps without CSS skills won't look much better.

Re:Electron is flash for the desktop (2016) by saagarjha on Wednesday February 13, 2019 @02:02PM (#19155685)
> and lets not forget, it looks like this

What are you trying to show here?

Re:Electron is flash for the desktop (2016) by sime2009 on Wednesday February 13, 2019 @04:38PM (#19157306)
> You can use it with virtually any language you want.

huh!? When did this happen?

Spoiler Alert: It didn't.

Re:Electron is flash for the desktop (2016) by dtech on Wednesday February 13, 2019 @01:38PM (#19155458)
Qt is not suitable for building web pages/apps.
Re:Electron is flash for the desktop (2016) by bdcravens on Wednesday February 13, 2019 @02:35PM (#19156051)
> This "web programmers are dumb" attitude is nothing but elitist rhetoric.

I don't think that's the attitude. The attitude is that they are lazy/stubborn, not dumb. I personally believe most developers are smart enough to keep learning. Whether or not they are willing to put in the work is the question.

Re:Electron is flash for the desktop (2016) by Gibbon1 on Wednesday February 13, 2019 @01:49PM (#19155558)
> Why is there always someone ready to jump in with this elitist nonsense?

Because it's absolutely true. You'll know it once you watch a web dev try and work on desktop app.

Re:Electron is flash for the desktop (2016) by SquareWheel on Wednesday February 13, 2019 @04:33PM (#19157268)
People working outside of their comfort zones generally don't know all the answers. That goes both ways. I recently watched a desktop developer reach for a Java servlet because they didn't know Javascript.
Re:Electron is flash for the desktop (2016) by Gibbon1 on Wednesday February 13, 2019 @06:24PM (#19158173)
I think thee is also definitely a problem where if you don't use the right/current fad/popular stack you'll have a lot of trouble hiring people to work on your stuff.

Especially true since front and back end web stuff is so huge and high paying. problem comes when those stacks are a very poor fit for the problem at hand. But sure you could get an old neck beard to write that in C++ instead of java/Ruby or Node.js. Great you only need a single core embedded processor and it doen't even get hot! And yeah then who's going to maintain it?

Re:Electron is flash for the desktop (2016) by happy_man on Wednesday February 13, 2019 @02:44PM (#19156182)
"They only need to write a new feature once. Crazy, right?"

Yeah!, why you old farts want me to learn about the stack, the heap and all of that OS architecture crap?, I don't need or want that #$@&*, I barely can keep up with all the JavaScript frameworks/libraries/toolkits that came out last week!

Re:Electron is flash for the desktop (2016) by JustSomeNobody on Wednesday February 13, 2019 @02:19PM (#19155846)
Wait a minute. I have seen the argument for Electron because devs "get" to use one language they already know. So, let's just take a step back and reset...
Re:Electron is flash for the desktop (2016) by sime2009 on Wednesday February 13, 2019 @01:23PM (#19155288)
> Electron is only the best way to do something when someone knows only javascript and web dev but doesn't want to learn a new language.

What toolkit or library would you propose instead? Seriously, what are these great alternatives? Doesn't necessarily have to support JS.

Re:Electron is flash for the desktop (2016) by nv-vn on Wednesday February 13, 2019 @01:37PM (#19155444)
There's a ton of really popular, well-supported options

* GTK

* Qt

* WPF for Windows

* JavaFX

* Tk

* LibUI

I'm rooting for https://github.com/revery-ui/revery/ right now too, but it's still early in development

Re:Electron is flash for the desktop (2016) by sime2009 on Wednesday February 13, 2019 @04:23PM (#19157163)
> GTK

GTK hasn't been well maintained or developed for ages and has always had poor docs. I wouldn't feel confident trying it on any platform which isn't its home (i.e. Linux).

> Qt

Qt is probably the best option in the list but it's language support is poor, only C++ and Python are practical. It is a big fully featured and mature library, but developing with QML is a poor experience compared to the tooling available on Chrome/Electron. Packaging and distributing Python and/or C++ Qt apps is a huge PITA too.

> WPF for Windows

not cross platform

> JavaFX

JavaFX looked interesting but just didn't seem to take off and develop a reasonable ecosystem around it. Certainly nothing that could rival the web ecosystem. I do love the language support that the JVM delivers. Regarding deployment size it isn't likely to be much better than Electron as most apps have to ship the whole JVM anyway. The stench of Oracle does taint it these days too.

> Tk

be serious

> LibUI

This isn't mature yet and it looks like another optimistic adventure in "write once, debug everywhere" like WxWidgets.

None of the options here can compete with Electron in terms of ecosystem or developer experience (often Chrome's dev tools). Nor are they built on open standards. Also JS is up there with the JVM and .Net platform in terms of languages which target and can run on it.

Re:Electron is flash for the desktop (2016) by munchbunny on Wednesday February 13, 2019 @01:58PM (#19155646)
As someone who used to develop with some of those options, I'm frankly glad that I can use HTML/CSS and Electron + React. It's much easier on the developer, even if it's less performant for the end user.
Re:Electron is flash for the desktop (2016) by doodpants on Wednesday February 13, 2019 @02:37PM (#19156078)
That's exactly the problem: the developer prioritizing their own convenience over the end user experience.
Re:Electron is flash for the desktop (2016) by munchbunny on Wednesday February 13, 2019 @03:16PM (#19156519)
I can also just not write the software.

It's not like I don't get the pain of slow tooling. I cut my teeth on C++. However, it's not a laziness issue, it's trading performance in one place for functionality in another. Case in point, at the time I chose C++ because I was trying to do game development in the pre-unity days. These days I'd choose Unity in a heartbeat because it's fast enough and saves me a lot of busywork. I could write more performant code from scratch, but it's really not worth the extra months spent wrangling polygons because the game never gets made.

Re:Electron is flash for the desktop (2016) by nv-vn on Wednesday February 13, 2019 @02:38PM (#19156100)
Which options in particular? I'm guessing Gtk or Tk might be pretty annoying to work with.
Re:Electron is flash for the desktop (2016) by faissaloo on Wednesday February 13, 2019 @02:57PM (#19156348)
Gtk is mostly annoying to work with because the documentation is poor.
Re:Electron is flash for the desktop (2016) by Pfhreak on Wednesday February 13, 2019 @01:46PM (#19155532)
How many of those run on the web as a platform? (A cursory search suggests 'not many' or 'not without some effort'?)

There are some components I'd ideally like to avoid rewriting for my web and desktop applications. (E.g. why should I have to write render code for my friends list component more than once?)

Re:Electron is flash for the desktop (2016) by nv-vn on Wednesday February 13, 2019 @02:38PM (#19156086)
I'm sure Revery does, don't know about the others.
Re:Electron is flash for the desktop (2016) by 8draco8 on Wednesday February 13, 2019 @01:10PM (#19155145)
1% difference is a lot in software development. Electron is like Flash, it allows cross platform apps with one codebase. By the way Flash used ActionScript which have a lot in common with JS so that’s another similarity.
Re:Electron is flash for the desktop (2016) by derefr on Wednesday February 13, 2019 @01:30PM (#19155366)
Electron is the best way for a third-party to wrap someone else's web-app into a more-fully-featured desktop app when that someone else doesn't want to ship a native app.

For example, there are a number of desktop Facebook Messenger "clients", that can pop OS notifications and so forth. They're all based on Electron. None of them are built by Facebook.

Similarly, there are a number of desktop Gmail "clients", not built by Google. They're all Electron, too.

The only alternative to this approach, would involve reverse-engineering the company's web-app's (proprietary, undocumented) API to write a native client library for it, and then constantly fighting the company as they try to block your native client library from being able to access their backend service. Some projects do that (there are at least two "native Gmail clients" that are actually native and are built on a reverse-engineering of the Gmail web-app backend API) but it's really not worth it if you're just a dev trying to scratch your own itch of wanting better desktop integration from these web-apps.

Re:Electron is flash for the desktop (2016) by reificator on Wednesday February 13, 2019 @01:08PM (#19155115)
I have never seen Qt be proposed without immediately being shot down for the licensing.
Re:Electron is flash for the desktop (2016) by michaelmrose on Wednesday February 13, 2019 @01:17PM (#19155222)
I was under the impression that it was available under the lgpl and only had to open source changes to the actual library that you aren't likely to need to make not your application.
Re:Electron is flash for the desktop (2016) by reificator on Wednesday February 13, 2019 @05:34PM (#19157808)
It doesn't matter what the actual requirements are, the issue is that it gets dismissed out of hand for the perceived requirements.
Re:Electron is flash for the desktop (2016) by emilsedgh on Wednesday February 13, 2019 @01:18PM (#19155243)
Which is usually based on just misunderstanding LGPL.

You "can" write a proprietary app with Qt and you wouldn't have to pay for it.

Re:Electron is flash for the desktop (2016) by reificator on Wednesday February 13, 2019 @02:40PM (#19156126)
Misunderstanding or not, that's the reason.

With most software developers and most managers not moonlighting as lawyers, misunderstandings are to be expected.

Re:Electron is flash for the desktop (2016) by jakelazaroff on Wednesday February 13, 2019 @01:20PM (#19155270)
Why did you put "can" in quotes?
Re:Electron is flash for the desktop (2016) by dx87 on Wednesday February 13, 2019 @01:28PM (#19155345)
You have to ensure you keep your business code separate from the Qt code. It's extra work that people might not want to deal with when they are more comfortable with other options that don't require special care.
Re:Electron is flash for the desktop (2016) by camgunz on Wednesday February 13, 2019 @02:02PM (#19155680)
To be specific, if you modify actual Qt code--which you shouldn't be doing generally--then you have to release those modifications.

But if you dynamically link your app with Qt you're fine; you don't have to open source anything.

Re:Electron is flash for the desktop (2016) by Buttons840 on Wednesday February 13, 2019 @02:19PM (#19155854)
You also must provide the Qt source code yourself, giving instructions on how to get Qt from the official website is not sufficient.

You also must allow relinking of your proprietary binary with different versions of Qt. This is easy on desktops but not on embedded or mobile devices.

You also may not begin using a commercial license for your proprietary code which you developed using the LGPL licensed Qt, unless you have written permission. Part of this also means you cannot use, let's say, a MIT licensed wrapper or utility for Qt, because that was probably developed against the LGPL licensed Qt, and thus cannot be used with a commercially licensed Qt.

There's certainly a reason people worry about Qt licensing.

Source: https://www.qt.io/faq/

(And despite all this, let's remember how great it is that one of the best widget toolkits in the world is open source.)

Re:Electron is flash for the desktop (2016) by camgunz on Friday February 15, 2019 @05:38PM (#19175381)
I don't mean to be harsh, but everything you wrote here is either wrong or misleading.

> You also must provide the Qt source code yourself, giving instructions on how to get Qt from the official website is not sufficient.

This isn't true [1].

> You also must allow relinking of your proprietary binary with different versions of Qt. This is easy on desktops but not on embedded or mobile devices.

If I'm distributing a game written with SDLv1 on mobile, I don't have to do anything at all differently than if I distribute the exact same game on desktop. Many, many games did this.

> You also may not begin using a commercial license for your proprietary code which you developed using the LGPL licensed Qt, unless you have written permission. Part of this also means you cannot use, let's say, a MIT licensed wrapper or utility for Qt, because that was probably developed against the LGPL licensed Qt, and thus cannot be used with a commercially licensed Qt.

This is also not at all true [2], in fact they couldn't release Qt under the LGPL if it were. That would be LGPL with a non-commercial-use clause, which would be incompatible.

> There's certainly a reason people worry about Qt licensing.

Yeah and honestly, it's because there's a lot of bad information out there. GPL and LGPL are subject to so much FUD. We as developers have a responsibility to know the facts.

[1] https://copyleft.org/guide/comprehensive-gpl-guidech10.html#...

[2] https://www.qt.io/faq/ (section 3.7)

Re:Electron is flash for the desktop (2016) by seba_dos1 on Wednesday February 13, 2019 @02:09PM (#19155742)
No, you don't. You just need to provide a way to replace or relink Qt libraries. Unless of course you modify Qt itself, but then you only have to publish those modifications. Absolutely nothing requires you to "keep you business code separate from the Qt code".
Re:Electron is flash for the desktop (2016) by simion314 on Wednesday February 13, 2019 @01:23PM (#19155300)
I am wondering what is the issue with dynamically linking Qt, are developers statically linking with MS c/c++ runtime or GUI libs ? From my experience you must install c++ runtimes on windows or if you use C# you need to ask your user to make sure to have it installed, where with Qt you ship the dlls.
Re:Electron is flash for the desktop (2016) by dwaite on Wednesday February 13, 2019 @02:05PM (#19155707)
My understanding is that Windows has an odd memory allocation system where each DLL has its own allocator. Qt historically wasn't designed for that; it will allocate and return objects on the heap with the understanding that user code will free them.

They may have solved this since by using a custom allocator on windows for Qt types.

Re:Electron is flash for the desktop (2016) by simion314 on Wednesday February 13, 2019 @02:27PM (#19155963)
Is this related to statically linking? HOW are alternatives like Electron? can you bundle your Electron app into a big binary file ? From my experience in year back when doing desktop apps there was never a pressure to combine your dependencies into 1 big binary
Re:Electron is flash for the desktop (2016) by beamatronic on Wednesday February 13, 2019 @01:10PM (#19155143)
Isn’t Gnome/GTK supposed to be kind of close?
Re:Electron is flash for the desktop (2016) by faissaloo on Wednesday February 13, 2019 @02:56PM (#19156337)
>Electron is only the best way to do something when someone knows only javascript and web dev but doesn't want to learn a new language. More like Electron is only the best way to do something when you're a business that's in dire need of developers and needs a cross-platform solution.
Re:Electron is flash for the desktop (2016) by jrs95 on Wednesday February 13, 2019 @01:33PM (#19155404)
Even if you were equally proficient in C++ and JavaScript, you can't tell me that Electron isn't significantly more productive.
Re:Electron is flash for the desktop (2016) by seba_dos1 on Wednesday February 13, 2019 @08:11PM (#19158814)
It really isn't. Even the multiplatform aspect of Electron is PITA - abstraction layers are so poor you usually have to support every platform separately by yourself if you want to reliably use stuff like systray icons or notifications.

Well, there's one exception - it sure is more productive if you already have a webapp to reuse.

Re:Electron is flash for the desktop (2016) by AnIdiotOnTheNet on Wednesday February 13, 2019 @01:45PM (#19155527)
Add up all the time and resources wasted by an Electron application for all users over the lifetime of the application, then compare that to the amount of developer time supposedly saved.
Re:Electron is flash for the desktop (2016) by scottlu2 on Wednesday February 13, 2019 @01:55PM (#19155624)
It’s about time to market and iteration speed being important success factors, coupled with users accepting the costs in exchange for the benefits.
Re:Electron is flash for the desktop (2016) by AnIdiotOnTheNet on Wednesday February 13, 2019 @01:59PM (#19155649)
So it is ok because money? I don't accept that reasoning. Computers today are orders of magnitude faster than they were in the past yet this concept of developer time being so much more important than everyone else's has them still feeling slow and unresponsive on essentially the same tasks we were performing 30 years ago.

This is why I hate this industry.

Re:Electron is flash for the desktop (2016) by jrs95 on Wednesday February 13, 2019 @06:18PM (#19158115)
It might feel like this, but if you boot up an old Windows XP machine and edit some text, it's still going to feel slow as hell in comparison to Atom on a modern machine. We get used to what's "fast" to do on our computers, and anything significantly slower than that feels "slow". And sure, the software is much less efficient. But compare it on hardware from the time it was developed, and it's not as bad as it seems.

And it's not just about money. With Discord as an example, they are able to quickly develop and deliver a great product, iterate on new features and integrations, and support all major platforms including web browsers. Their choice to use a web based stack helps A LOT with this.

Re:Electron is flash for the desktop (2016) by scottlu2 on Wednesday February 13, 2019 @02:15PM (#19155808)
I think it’s an economic reality for for-profit companies that make apps. If company A doesn’t go the html app route, and company B does for the same effective product, company B will have an advantage. It’s almost to the point where if your company app can be developed this way, you must do it this way to stay competitive.
Re:Electron is flash for the desktop (2016) by gammateam on Wednesday February 13, 2019 @02:01PM (#19155665)
> Electron is only the best way to do something when someone knows only javascript and web dev but doesn't want to learn a new language

and when you want to fire all the obsolete specialists while making a product with one person that works for everyone. I mean, you can keep one specialist, since they know javascript too

Re:Electron is flash for the desktop (2016) by x0x0 on Wednesday February 13, 2019 @01:14PM (#19155194)
electron also allows sharing code between web and mobile, plus the cross platform. afaik qt doesn't address that.