by rectang · 4y ago · 0 comments
We aren't solving the same problems our forebears did. People weren't designing native apps with pencil and paper when somebody figured out how to bundle up the Chromium Embedded Framework, but they were burning tons of time duplicating effort on multiple native apps because OS platform vendors are manically determined to lock us in and stop us from writing portable code.
You might begrudge the resources used at scale, but if these programs weren't built in the first place it would be net negative. I also don't see Slack coded in GTK for instance, if it wasn't electron it would have been some Java framework, and I'm not sure it would have been better.
Comparing VSCode with Eclipse (which was optimized compared to other frameworks....), I'm pretty happy with VSCode and think we came a long way.
Java Swing is much more responsive and light when compared to Electron. Java is no longer heavy since the first Core series processors of Intel, and it's visibly optimized to be lighter and faster every release.
> Comparing VSCode with Eclipse (which was optimized compared to other frameworks....), I'm pretty happy with VSCode and think we came a long way.
Eclipse of today can run circles around both the Eclipse of yesteryear and VScode in terms of performance, resource utilization and capabilities.
I'm using Eclipse for 20 years (and still using it), and just because it's old enough to get a driver's license, it doesn't mean it's obsolete or featureless.
I don't think so. Different programs might have been built in a more efficient framework instead.
I remember a very similar complaint being made about Eclipse, Java, and Swing as you make about Electron, JS, and Node as a cancer on the desktop.
An alternative history where Java would have been huge on the desktop doesn't look to me like we'd have a heaven of well-though lightweight apps TBH.
I personnally think npm is something inevitable, and am not sure Maven for instance is fundamentally better in the grand scheme of things (I'd argue as a dev it's way more of a PITA without any specific upside, but it might be my own incompetence).
The only critic I ever faced with this was that it was not classical nor "the proper way", but the fact it loaded instantly and worked exactly the same way albeit infinitely faster managed to convince we may not need all that jazz.
You always have a choice but you'll face more resistance and worry not to go with everyone else towards suicide by a thousand dependencies.
A bit of inefficiency is alright, but things get ridiculous if modern web pages actually run less smooth than programs 40 years ago despite having quadrillion times the computing power available - because this power is wasted to write objects to JSON half a dozen times or simulate a network architecture between a virtual server and a virtual client which actually reside on the same machine - all because that's the only architecture modern web developers seem to understand.
Typescript + Next.js + Electron would be much, much faster for me to develop for than GTK + C, and even than Python + PyQT.
I wish there existed a modern cross-platform open source reactive GUI framework which was less of a resource hog than Electron, that would be great! Qt specifically is not much more economical, though the redistributable is smaller. Java is also rather nice for cross-platform GUIs, and also rather a hog.
Sadly, Electron is not so outstanding wrt resource consumption :-/
Flutter (Desktop) comes pretty close to that. Its really fast to write and your code works on IOS/Android/MacOS/Windows/Linux unless you need Platform specific API's, and even that is possible.
in the case of Electron, probably. it is comparatively difficult to release a cross platform graphical application in any other way.
in the case of other "high level" languages like Python, almost certainly not.
I remember reading something on Dropbox' engineer or developer blog about their conversion from Python 2 to Python 3 and how well it went for their desktop client, which had over one million lines of code and I had to stop and reread that a few times to make sure I read correctly.
How "high level" is Python if this many lines of code are required to create the Dropbox client? maybe Python is the epitome of a high level language, I don't know, but if it is, I don't see how one million lines of Python saves anyone any time over something low level like C or even Assembly, really. the promised tradeoff of execution speed for programmer productivity isn't there, at all, and almost no one sees it.
even if the majority of those lines of code are in libraries, why do those libraries have so many lines of code? what can they possibly be doing to need that many lines of code? it really does boggle my mind.
entire operating systems require fewer lines of code than the Dropbox client, and are written in languages that are supposedly much less expressive per line of code. so where is this supposed developer productivity when it takes over one million lines of code to write the Dropbox client?
I'm not trying to pick on Python, specifically, mind you; this is just an example I was thinking about recently. I'm quite sure that there are other tradeoffs also not delivering what they promised at all in all other languages, and I'm 110% certain no one is noticing those, either.
Unless you've spent lots of time (half a decade or more) at each layer of "full stack", it is really hard to comprehend just how mind-bogglingly fractal systems requirements get the more users you expose them to. Anytime you go b2c, or even b2b with a large enough user base, be prepared to say, "huh, I didn't see that coming" once a week or more frequently.
There are entire problem domains that lay submerged until you reach certain scales. Some code bases reflect the encapsulation of those submarine domains; some don't, most assuredly, but until the software becomes unused, at my clients I never ask the question the way you ask. Instead, I ask them to walk me through the code at successively finer-grained conceptual blocks until I reach the level where I can start attacking the problem I've been brought in to help address.
wxWidgets has been enabling cross-platform native graphics since the 1990s. Though the overall development experience is rather MFC-like, and not to many people's taste.
I do somehow agree with you, but going from Assembly to C was a huge step, from C to Java/C# a huge step due to GC and better typing.
Python indeed does not feel much higher level to me than e.g. C#, the only reason I've ever really seen why people save lines of code is the lack of braces, which doesn't really matter IMO, and because there are so many libraries. A big reason why there are so many libraries? I guess because people think it's easy, nothing innate in the language, certainly not that it's easy to package stuff.
Do you have some baseline to which we can compare? How many lines "should" it take?
I ran `git clone` on the repos of both rsync[0] and the official Dropbox SDK for Python[1]. I then ran sloccount on both of them.
---
rsync came in at a total of 51,410 physical source lines of code.
The Dropbox SDK came in at a total of 74,140 physical source lines of code.
---
(This data generated using David A. Wheeler's 'SLOCCount'.)
By no means do I wish to awaken the ghost of that infamous HN comment on how easy/why someone else had not done those bells and whistles before.
For instance when comparing VSCode to Visual Studio or Xcode, VSCode isn't universally slower, far from it. VSCode is much faster from start to first keystroke than both VS or Xcode. In other areas it's not so clear, some actions are slower in VSCode, some are faster (and before "but VSCode is a text editor, not an IDE", with the right plugins VSCode is as much an IDE as it needs to be).
So if even the Visual Studio or Xcode teams at Microsoft and Apple can't create applications that are universally better than an Electron application, why should 3rd party developers care about creating "native" applications?
The Windows and macOS platform teams don't seem to have quite understood yet that they are in competition with Electron, and in order to compete, they have to make it easier to create cross-platform applications than what Electron provides. Nobody will choose native macOS or Windows APIs just because they provide a "native look and feel" (which neither Microsoft nor Apple care about all that much in their own applications either).
I suspect that the applications that use up a core when idle would do this also if Electron is not used (e.g. it's a property of the development team, not of the framework).
Sorry, but that’s both flat out not true, and a fundamental misunderstanding of what the role of a platform vendor is.
If Apple wanted to ban non-native apps on iOS it’s hard to see what would stop them. They’re clearly fine with them. Microsoft has even embraced cross platform development wholeheartedly with many Electron apps, and more to come. They’re even plumbing the chrome engine into Windows to make sharing it more efficient.
The role of a platform vendor though is to make the best platform for native development they can. Portability to other platforms, with a few exceptions such as POSIX, just isn’t their problem. There’s no particular reason it should be. It would just stifle innovation and lead to boring me-too systems that are stuck in the past. That’s simply not in the interests of users or vendors.
Even electron apps aren't new, we already had that disease once with Active Desktop and packaged web sites.
There is some hope that like 20 years ago eventually the bubble will burst.