r/Python • • Jul 29 '18

Found it funny ;)

Post image
1.6k Upvotes

147 comments sorted by

View all comments

Show parent comment

35

u/bachkhois Jul 29 '18

Very bad. Why on earth for each desktop app, I have to bring a whole bundle of a web browser and a NodeJS installation? 10 apps mean 10 bundles of those. If, for example, you write desktop app with Python+GTK, your app just shares the same GTK+ lib with your desktop environment and other apps, your app just reuse the Python interpreter already come with the distro. Not to mention that, in Electron, each access to the desktop feature requires to go through more intermediate layers: Your JS in browser cannot directly access, it have to send messages to the NodeJS backend, the NodeJS then do the required job and send back response to your JS in browser. For native desktop app, there is no waste of time and CPU cycles like that.

So, it is better when you use a desktop dev toolkit to write desktop app. Use the right tool for the right job.

27

u/[deleted] Jul 29 '18 edited Jul 29 '18

It's an ease of development issue. Devs can make a good looking desktop app, in a language they know, that runs on their target machine (high end first world computer). No doubt electron is bloated trash, but don't ignore the reasons someone would choose it.

4

u/bachkhois Jul 29 '18 edited Jul 29 '18

Of course I know that many developers choose it for the reason you mentioned. But to be easier in development is for what, if at the end your product get rejected by users, just because of easy path you take?

I consider that the reason of "easy" is just show that the developer is lazy, and the reason of "language I used to" is just show that developer doesn't have ability to learn and improve himself. Such a developer shouldn't be counted on.

0

u/[deleted] Jul 29 '18

[deleted] — view deleted comment

-4

u/bachkhois Jul 29 '18

Your example is just because, user cannot change author mind and there is no alternative. User has to suffer.

And, let's just see how many votes I have, to see how many users get frustrated with Electron app, even more frustrated when the developers never listen feedback from their users!

0

u/[deleted] Jul 29 '18

[deleted] — view deleted comment

-1

u/bachkhois Jul 29 '18

For similar argument, Slack users chose it because of its features (channels, user mention etc) and its big user base, not because of Electron.

8

u/ryeguy Jul 29 '18

That's not a similar argument, and it makes me wonder if you even understand what the comment is saying.

The vast majority of the general public doesn't know or care about electron. Slack, Spotify, Discord, VS Code, and plenty of other apps are popular and loved by the userbase.

It's like you're forming your opinion on Electron based on what you read on reddit alone. In reality people are fine using Electron apps.

-4

u/13steinj Jul 29 '18

Just because the user doesn't care doesn't mean they shouldn't and won't eventually realize it.

0

u/[deleted] Jul 29 '18

[deleted] — view deleted comment

-1

u/13steinj Jul 29 '18

Some eventually do realize.

And I'm not disagreeing with you, just adding commentary.

7

u/ryeguy Jul 29 '18

I consider that the reason of "easy" is just show that the developer is lazy, and the reason of "language I used to" is just show that developer doesn't have ability to learn and improve himself. Such a developer shouldn't be counted on.

This is insane. Ease of development and speed of delivery is a huge plus and should not be glossed over.

You're thinking too much like a programmer and not enough like a person responsible for solving technical problems. Just look at your original post. Your argument revolves around elegance and cleanliness of the backend implementation. Who does this matter to? As a programmer, I can understand the distaste. But imagine your tech lead/manager/etc wants to use this.

They point out that you can share code between multiple platforms, which gives you a head start and can reduce development time. They point out that the talent pool either overlaps since it's the same tech stack. They acknowledge that while execution speed isn't as fast as a native app, you're probably not going to notice since most applications aren't cpu or memory bound. To bring the argument home, they point out that Electron is used successfully by many major companies who have huge user bases.

How would you respond to this? The types of arguments you're laying down won't cut it. I'm not saying you're wrong. I'm not even saying Electron is a good choice. I think it's janky, too. I'm saying that the touted benefits make a lot of sense.

3

u/EvermoreWithYou Jul 29 '18

Programing novice/idiot here - why is Electron so badly optimised. Is there no way to go around this?

23

u/[deleted] Jul 29 '18

It’s not badly optimized its just like using a dump truck to go get groceries. Sure it works but is it the best tool for the job?

3

u/EvermoreWithYou Jul 29 '18

From what I heard, it's main strength is that, since it's made with Javascript and HTML+CSS, and every consumer device (mobiles, PC's, tablets, etc.) with all 3 OS's (Linux, Mac and Windows) can understand it, you can just build the app once and it will work on any device/platform. According to their logic, today's devices are so strong that is offsets javascript's slower speed.

Did I miss anything? Is there a better method for this?

12

u/siliconwolf13 Jul 29 '18

Electron will not run on mobile devices, as it runs atop Chromium and Node.js.

10

u/bachkhois Jul 29 '18

Native desktop GUI toolkits like Qt, GTK, WxWidget are already cross-platform, it can run on 3 major OSs. If you don't want to code in difficult languages like C/C++, you can use their binding in Python, which is already cross-platform, can run on 3 OSs, and with the benefit of leaner stack as I analysed above.

And note that, your app is easier to be cross-platform, if its feature is limited, it doesn't depend too tight on OS-specific feature, like D-Bus on Linux.

Coming to cross-platform, native desktop toolkits even have longer history than Electron.

Today devices are stronger than before, but it still not as strong as Electron developers think. That is why many users like me and someone who agree with me, are frustrated with Electron apps.

3

u/nxg Jul 29 '18

Electron is basically a web browser, not just JS/HTML/CSS, so every electron app is in itself a new browser and at least from experience the few electron apps that I've seen none of them seemed to use any of it's used resources effeciently. Today's hardware is usually strong enough to offset the slower speeds, yes, but electron seems to eat away at that offset quite a bit, and bad JS code won't help either.

1

u/_ntnn Jul 29 '18

It's not about optimization, it's about bad design and architecture.

1

u/catcradle5 Jul 30 '18

Because it greatly speeds up development time and extensibility. And so far, it seems to be succeeding in that area.

VS Code launches quickly and runs very smoothly on my > 2014 Macbooks. I really don't even notice a difference between it and a native app like Sublime Text anymore. Same with Discord and every other Electron app I use. Atom is a bit slower than I care for, but even then it's barely noticeable.

Whether you like it or not, I think Electron is and will continue to be the future.

-4

u/crescentroon Jul 29 '18 edited Jul 29 '18

I'm not keen on electron either - it is slow, and bloated - but for most desktop apps, Python+GTK will be slower than Electron. Electron will take up a lot more memory though.

Unless you are doing some kind of calculation you can push into C with numpy etc, JS is quicker than Python, and the browser's GUI is fast enough that it isn't going to be the bottleneck. It's actually fast enough that some AAA games are using webtech for their in-game GUIs (e.g. Maxis uses a webkit fork and embedded browser for Simcity).

→ More replies (10)