I like the idea behind it though.
I like the idea behind it though.
Electron wins because Electron apps are able to deliver consistently decent UX, something that never happened with Swing or GTK+ or WxWidgets or whatever.
Sure, it eats RAM. It turns out that I care about that so much less than I thought I would. I'm rarely using 100% of my system's RAM these days, so I'm willing to burn a couple hundred MB on widgets continuing to be sensibly drawn and laid out when I resize the window.
It's just that when I hear a "simple markdown editor", I don't envision an app with a bundled web browser. I'm sure it looks great and all that.
As far as the argument goes, I'm not sure they're really separable. If you have an Electron app that markets itself as being simple (as in "easy to use"), and someone says, "No it isn't, because the stack it's built on is complex", their unstated major premise is that implementation details are more important than UI. Leaving it unstated doesn't mean it shouldn't be addressed head-on. One of a syllogism's legs can easily be both tacit and the crux of the argument at the same time.
That's right, now you just have to deal with open source OpenGL libraries or of course write it yourself.
Handle unicode, sub/superscripts, RTL text, typography nuances, LaTeX etc. by yourself.
(See more at https://gankra.github.io/blah/text-hates-you/)
Also do it in your free time because probably you won't make a living out of it.
So I totally understand why anyone would pick a browser engine where all of this is super easy to solve.
Have you heard of, say, Qt?
It sure is nice having a powerful developer machine with 16 or 32 gb of RAM. Just remember there are a lot of people out there running on 4gb laptops or even less. These days, the OS, web browser, and Slack alone are already enough to max it out and start swapping.
I'm also not sure you can just assume that an Electron app will be a giant memory hog compared to the alternatives. I just decided to go and give it a quick look-see. Right now I've got both vscode and IntelliJ IDEA open at the same time. (For my purposes, they're at feature parity, except that I don't like vscode's Java plugin). IntelliJ, a non-Electron cross-platform app, is consuming 3 GB of RAM. vscode, an Electron app, is using 50MB. That's 1/60 as much. Meld, a GTK+ app that doesn't do nearly as much, consumes 100MB just sitting idle, which is twice as much as the Electron app does.
I'll come out and say it: I suspect that, deep down, this argument is not really about memory or anything like that. It's really a proxy war about JavaScript. Which, I get it, I hate JavaScript too. I resolutely avoid working on things with UIs at work, probably to the detriment of my career, just to avoid programming in JavaScript. But I've also got to concede that Electron has accomplished something that everyone else has consistently failed at: Delivering decent cross-platform GUI applications. And it's pointless to complain about people using X technology when it has no truly viable alternatives.
Qt, Gtk+, WxWidgets... There are lots of ways to skin this cat.
Seems reasonable for 2019.
Also, in laptops you cannot upgrade the motherboard.
No? ~$100 is remarkably cheap for a new motherboard, especially if you are complaining about needing 32+GB of RAM, which costs substantially more than $40. If you want something like a $35 Raspberry pi, buy one and accept its limitations.
It does not make sense if 4 Gb mean that you can only run a browser and Notepad.
If, however, you are a bit older and you remember the time that you had the choice between 4 MB and 8 MB and people were still able to do all their computer stuff, including internet, in a graphical environment, then you thoughts are more in the line of: what the fuck are these lazy and incompetent programmers doing these days? And this is coming from someone who earns a living as a developer.
If you spend a half hour over the entire life of your machine even considering RAM, you might as well double it for $30.
Using RAM is good. It's fast, it's cheap, and anybody with 8 gigs has it in abundance
The Windows tablet/notebook (hybrid) being sold as their latest product by a company I'm doing business with at the moment has 4GB. It's a shame, because Electron would totally fit what their business runs on those tablets, which is a Javascript-based graphical environment...
I happen to have a Markdown file open in MacDown, a native application, right now. According to Activity Monitor, it's using 67.1 MB of RAM. I also downloaded Mark Text to take a look at it. So now I've got the same Markdown file open in that app, too. It's using 73.9 MB of RAM.
I will admit, that difference in memory consumption is equivalent to seven instances of vim, and I'll keep that in mind the next time I'm trying to get things done on a Raspberry Pi Zero. (As one does.)
But, on this 6-year-old computer, which does not have "over 8 or 16 GB of RAM", I'm still not sweating that 6.8 megabytes.
To test it myself, I started the program (with --no-sandbox because it requires root privileges otherwise) and measured memory usage using smem:
$ sudo smem --userfilter=nobody -k --totals
PID User Command Swap USS PSS RSS
23365 nobody /tmp/.mount_markteqQvqZF/ma 0 6.3M 14.2M 37.7M
23388 nobody /tmp/.mount_markteqQvqZF/ma 0 46.6M 59.4M 90.9M
23363 nobody ./marktext --no-sandbox 0 53.3M 76.3M 118.4M
23392 nobody /tmp/.mount_markteqQvqZF/ma 0 121.1M 142.3M 183.0M
PSS (Potential Set Size) [1] numbers are additive unlike RSS, so we can sum them and get around 291 Mb of RAM. This counts pages, that are shared between several processes, only once.Either MacOS uses RAM several times more effective than Linux, or Activity Monitor is showing incorrect numbers to make impression that Mac apps take less memory than apps on competing operating systems.
Wrapped web engine and the site does not an app make.
And yes, Electron isn't simple. No one cares. The product itself is simple to use (presumably). When they said simple, they were not referring to implementation details.