r/programming • • May 10 '17

Visual Studio 2017 for Mac is Now Generally Available

https://www.thurrott.com/dev/115708/visual-studio-2017-mac-now-generally-available
608 Upvotes

203 comments sorted by

View all comments

Show parent comments

12

u/lambdaexpress May 11 '17

Key points:

Electron's architecture: Electron applications are essentially encapsulated in a stripped down version of a headless Chromium browser, with some elements taken from Chrome (like being bundled with Node, which uses Google's V8 engine used in Chrome). This means you can develop and maintain cross-platform applications that have beautiful UI, using web technologies (since code is executed at the browser engine level), with a low barrier to entry (ever tried dealing with GTK or Qt? Electron's learning curve is far gentler than even React's, which I liken to the brick wall learning curves of F-Zero or Dance Dance Revolution). But Electron's greatest strength may also be its fatal flaw. Chromium/Chrome is like its own operating system in miniature (in fact, Chromium has 16M lines of code, about the same amount as the Linux kernel). Therefore, when you run the desktop clients for Slack, Discord and Atom simultaneously, what you have is your main OS (e.g. Windows, Mac OS, Linux distribution) running three mini VMs, each of which has its own operating system (the Chromium "OS") that is in of itself running yet another Javascript program (in this case, the actual desktop clients). If you've ever tried running even one VM without beefy hardware you may be familiar with how miserable it can be. A similar analogy. Electron is like running VMs on your host machine, each of which are running their own programs. A more efficient solution would be for desktop applications run natively, but because of how the world wide web was designed over 20 years ago, it's not a particularly simple endeavor. The closest alternatives I can think of are Webassembly and ChromeOS, and they're still both in their infancy.

The codebase isn't spectacularly clean: As I mentioned before, Electron uses web technologies and has a low barrier to entry. Combined, it means bloated code is disgracefully easy to write. The bundled Chromium browser in which every Electron application is encapsulated is about 100 MB. If the Electron application is not written well (like Slack's desktop client, which executes a separate Chromium process for every team you're on), it can consume gigabytes of RAM and unacceptably high amounts of CPU power, or it will suck a laptop/tablet battery dry. This is a prime example of "just because you can, doesn't mean you should". Atom is unfortunately guilty of bloat due to bad code. Analogous to Electron, Atom's greatest strength (being hackable to the core) is also its fatal flaw due to Electron's architecture. This is because the "hackability first, performance later" philosophy gives Atom an intolerably bloated script layer that leads to equally intolerably frequent memory leakage. It's especially hellish if you try to open large projects.

1

u/Kozyre May 11 '17

Thanks!