6 ms·
I would phrase the problem slightly differently: not "I want to use the technologies that make me enjoy my job," but "I want to use the technologies that I alre
by smacktoward 9y ago
I would phrase the problem slightly differently: not "I want to use the technologies that make me enjoy my job," but "I want to use the technologies that I already know."
Electron is popular because it lets you write desktop apps in JavaScript, and there are a lot of developers out there who know JavaScript. By going with Electron, those developers can build desktop apps without having to learn anything new. They can extend their existing skills into a new arena, without having to learn any new ones. Developers are always asked to turn products around as fast as they possibly can (and, um, also people are lazy), so this is a very powerful appeal.
This "I don't have to learn anything new" factor is literally the only thing Electron has going for it. Using any other alternative will result in applications that perform better, fit into their host environments more naturally, and generally work better than an Electron app will. But there are a lot of JavaScript developers out there, and any other alternative would require all those folks to learn a whole bunch of new stuff to get started -- new languages (C/C++, C#, Java, Python, etc.), new toolkits (UWP/Win32/Cocoa/whatever, Qt, WxWidgets, etc.), new programming paradigms, etc. etc. etc. Whereas with Electron they can pick it up and be productive in a couple of hours, which is a hugely appealing prospect.
Tools that let people leverage what they already know will always do better than those that require a whole bunch of learning up-front to use. Electron is just the latest example.
- Waterluvian 9y agoI don't disagree with your analysis, but I disagree that it's a simple rephrase. They are two separate issues: 1. Pros/cons of using tools we already know 2. Pros/cons of using tools we enjoy using I am awful at Docker because I started using it yesterday. But upon using it, I'm suddenly so attracted to it and am thinking about what fun personal projects I can apply it to. It's a beautiful technology. I am very strong in JavaScript but love avoiding it like the plague unless it is the appropriate technology. Edit: okay I'm skeptical of a part of your analysis. Please show me a detailed example of building a desktop app that runs on Mac/Windows/Linux, looks reasonable, and takes the same or less time from a competent developer. I am genuinely starving for an alternative to Electron that doesn't come with a significantly heavier dev/support cost.
- stupidcar 9y agoThe thing is, are those alternative toolkits better? Done right, they're faster, for sure. But when you use Electron you're leveraging thousands of man-years of Google developer effort to build a web browser that works consistently and well across different platforms. Although the web platform gets a bad rep for cross-browser compatibility problems and general weirdness, a huge amount of that goes away when you target a single runtime. Suddenly you can use every half-baked Chromium API and prefixed CSS feature without worrying about how it's going to break in IE 11. In that situation, you suddenly realise just how much power the web platform give you. You can style any element, any way you want. You have you have a complete, out-of-the-box object model for your whole UI, plus developer tools to help you debug it. You have advanced typography control. You can drop a canvas element in and get an immediate-mode 2D or 3D graphics API. You can layout stuff in flexbox or grid, or just as a plain old document (which most toolkits would delegate to an embedded web browser anyway). There are better languages that JS, that's true. But whether there are truly better cross-platform app toolkits than the web is, in my opinion, rather more unclear.
- mattgreenrocks 9y agoThat Google felt the need to invest millions of dollars into making a document delivery platform into something resembling an app platform is not really relevant here. Sure, it is robust. But the whole point of the thread is engineers are notoriously bad at asking what the customer _needs_ from a product vs what the engineer finds fun to write. You want to have fun as an engineer? Work on a side project. The larger the dependency, the more it should have to do to justify itself. "It's fun to write in" is not a sufficient justification for a 70mb dependency. "I need a cross platform app" is better. As an engineer, you're responsible for the transitive dependency graph that gets delivered to customer machines. If you want to take on gigantic dependencies because they are the current lovechild of ascendant Medium bloggers, be my guest. I prefer to go off of more than fun and social proof when making engineering decisions, however.
- flukus 9y ago> The thing is, are those alternative toolkits better? IME, yes. Most of those toolkits also have thousands of hours invested to work well across platforms, not consistently but natively, or at least a close facsimile of native. > In that situation, you suddenly realise just how much power the web platform give you. You can style any element, any way you want. You have you have a complete, out-of-the-box object model for your whole UI, plus developer tools to help you debug it. You have advanced typography control. You can drop a canvas element in and get an immediate-mode 2D or 3D graphics API. You can layout stuff in flexbox or grid, or just as a plain old document (which most toolkits would delegate to an embedded web browser anyway). So nothing that hasn't been true of desktop apps for decades then? If you want power then nothing beats being able to overide the paint method of a widget, you have complete and total control. If you're interested in seeing how easy desktop apps are I built the canonical todo list in Gtk (https://gitlab.com/flukus/gtk-todo/blob/master/main.c https://gitlab.com/flukus/gtk-todo/blob/master/main.c), the goal is a demo that's a bit more complex than hello world. This is in a language not known for it's terseness, uses one of the nastiest parts of the framework (GtkTreeView) yet it still comes in at less than 100 lines of fairly straight forward and simple code.
- ebiester 9y agoAnd note that outside of C, C++, .NET, and java, making a desktop means using a library built in another language with documentation in another language. (C has GTK and C++ has QT.) I started building an app in Rust against GTK with a Rust shim, but I only got so far before I had to start reading through GTK docs which meant understanding the C-derived documentation, on top of the Rust shim. If the goal is to learn GTK, Rust, and C, then it's not a big deal. If the goal is to build something that you need, you end up scratching it and going back to something you know already. (In my case? Java which has the underrated JavaFX 2.0. And I'm sure I'll look elsewhere some other time - I'd really like to learn Rust better, but I think I'll do something other than a desktop app, or at least wait for better documentation or more time.) That said, Lazarus looks really cool as well and may be the thing I always hoped for...
- Waterluvian 9y agoI experienced this too. Strong Python developer wants to build a GUI in a few days to help others perform a task. Uses PyQt, runs into segfaults (in Python?!) and has to drop down a level, understanding the implementation and nuances of QT.
- chappi42 9y agoForget Lazarus. There is no (finished) Cocoa for Mac. Development is not on Github. Syntax has no common style. Documentation is uneven. The whole ecosystem feels (well, is) dated. Of course, Lazarus/FPC is still quite nice. But to really shine and be a valid alternative, it would need a large infusion of money and manpower. Thus, don't hope too eagerly...
- badsectoracula 9y ago> There is no (finished) Cocoa for Mac. This is true but in practice the Carbon backend will work fine and if that isn't good enough you can use the Qt backend which uses Cocoa (but then you'd have to bundle Qt with your app which increases its distribution size a bit). To preempt a "then why not just use Qt" reaction, this isn't the same as using Qt since you can use the Win32 and Gtk backends in the other platforms. Cocoa is of course under heavy development, but keep in mind that there are only a handful of Lazarus developers that even have access to a Mac and they actually had to write a special dialect for the compiler (Objective Pascal) to be able to handle Cocoa objects directly without the need of an intermediate (like Qt that needs libqt4pas that exposes the Qt API as a C interface that is then linked dynamically with FPC through a C-to-Pascal binding). > Development is not on Github. This is not a negative, please do not enforce the GitHub monoculture, GitHub is not the be all end all of open source development. > Syntax has no common style. What do you mean? The IDE even provides formatting tools. > Documentation is uneven. Documentation is lacking in terms of detail but generally you can find stuff easily and things have improved tremendously over the last five years or so (it used to be that you had to have some old Delphi help file to find anything or dig into the source code). > The whole ecosystem feels (well, is) dated. Sorry but this doesn't mean anything, please be more specific because this feels like you just want to mudsling. > But to really shine and be a valid alternative, it would need a large infusion of money and manpower. Careful what you wish for, because more often than not having a company become a dominant player, it ends up steering a project against the wishes of the community. Lazarus, like Free Pascal, are fully community made projects and most of the people who work on it do it on their free time. On one hand you get a few rough areas like those you mentioned (immature Cocoa support, spotty documentation, etc) but on the other hand you do not have anyone throwing their weight around. For me Lazarus being community driven is a major feature. The biggest problem Lazarus has is simply the lack of developers, but this will only be solved with developers fixing the issues they face. Fortunately i've seen a lot of new blood lately in the mailing lists so i expect things to improve.
- vvanders 9y ago> This "I don't have to learn anything new" factor is literally the only thing Electron has going for it. Not completely, don't underestimate how hard it is to write a cross platform UI that runs on Windows, OSX and Linux. Starting from a web framework not only gives you portability but also a common UI language(that may diverge a bit from native app conventions but that's a tradeoff you need to weigh). I say this as a die-hard C++/native dev. I've done wxWidgets, QT and a bunch of others and it's never a trivial thing to do.
- ihnorton 9y agoThe other thing to keep in mind is that a similarly script-extensible Qt application carries the weight of Qt shared libraries, plus scripted wrapper shims. This can easily run 25-40 MB in Python-Qt systems, at which point 70 MB for Electron looks much less crazy. (also a C++/Qt dev, jealously eyeing love preview, hot-reloading, and other niceties).
- clarry 9y ago> Starting from a web framework not only gives you portability ... except when you actually need to actually, you know, port it, to a platform it wasn't already ported to out of the box.
- deleted 9y ago[deleted]
- sjellis 9y ago> Tools that let people leverage what they already know will always do better than those that require a whole bunch of learning up-front to use. Electron is just the latest example. Yes. In "Code Complete", Steve McConnell argues that although a programmer can learn a language syntax in a couple weeks, mastering the language, tools and libraries that make up a platform can take a couple of years. In other words, asking developers to build and maintain non-trivial products in a language that they don't already know is an even bigger burden than you might think, to the point that it's probably an unreasonable request.