Hacker News new | past | comments | ask | show | jobs | submit login

Nah, we ended up with Electron because we have more front-end devs than C++/C#/ObjC devs and because doing layout in HTML + CSS is a million times easier than in native frameworks (AppKit and UIKit aside, those are nice).

It being cross-platform is probably secondary.




I was a mobile dev, mostly native iOS and some android/kotlin, for better than 10 years. I still maintain a dozen apps from my days as a full time consultant.

Before consulting I did web dev in early 2000s when the stack was LAMP and JavaScript felt like something that would never mature into anything. Hell, I was in my late teens so the feeling was likely mutual.

All this to say, good god, autolayout and storyboards and stack views. Last Friday I spent TWO HOURS troubleshooting why a UILabel wouldn’t word wrap inside two UIStackViews.

I’m so grateful for electron. It’s allowed me to become an indie dev and embrace/leverage react and the entire JS ecosystem to bootstrap a successful company.

My indie success would never have been possible if it wasn’t for these “inefficient” dev/deployment desktop stacks. And if they allow lowly old me to sell software to thousands of users around the world then they are doing something right. I hate to say it, but they really allow me to be 10x of what I’d be solo on mobile. Electron/React has that much potential when focused on solving a few painful tasks for my end users.


> JavaScript felt like something that would never mature into anything. Hell, I was in my late teens so the feeling was likely mutual.

Just want to say thanks for this gem ;)


I agree with the first part, but not with the second. Doing layout in e.g. WPF or QML was way easier than anything we had in HTML until flexbox became a thing - which is to say, for many years. Simply because those frameworks were designed from the ground up around laying out widgets, while HTML was oriented more towards document-like flow for a very long time.


Yeah, but flexbox came around 2012 and Electron came around 2013. Web UI weren't that popular until electron.

WPF is well, windows only. QML is C++ or python and didn't look native at all, but it also didn't look very pretty either. With HTML + CSS you can easily make an eye candy.


Sure, but we do have flexbox now. And CSS grid. And have done for over a decade.


The question was why HTML-based UI became popular. And that predates widespread support for all these things.


Flexbox was supported in chrome since Chrome 21 (2012). Electron initial release was in 2013.

To make an electron app, you only care about that your chrome runtime support.


I agree with your first bit, but so far have been unable to find layout tools for HTML/CSS that compare to the ease of the VB6-era drag-n-drop component editor. I'd love to know of one, though.


Those tools didn't work well for things that need to adjust to different screen/window sizes or even for localization causing text elements to change size. For that kind of stuff you need some kind of dynamic layout like springs & struts, flexbox, etc. I think Qt and XCode have drag and drop UI designers for layout systems that work that way, instead of picking an exact position for things you pick their location and size relative to their contents and things around them. I find just using CSS to be easier to think about than those but they're nice for trying things out.


I find it's hard to rat-wrestle your way to a GUI that adapts nicely to different window sizes, resolutions, etc. Xcode probably comes the closest but I haven't tried it in years. I know there are purists who think "well, it's a VISUAL interface so you have to lay it out VISUALLY!" but this is actually trickier than you might think when you have to render the UI in a different context from when you created it.

I've found it easier just to do declarative layout. Tcl/Tk does this real well, and has since the early/mid 90s. I know that Tk uses imperative commands to build out the UI scene graph but it's effectively declarative. Tcl/Tk is pretty much VB done Unix style.


Except they always supported flexible layouts as well, no need for absolute positioning.


> doing layout in HTML + CSS is a million times easier than in native frameworks

Nonsense. Doing layout in Qt is much, much nicer than HTML/CSS. If you could just push a button and get executables for all the major platforms, by default, like you can with Electron, it would be winning.


> doing layout in HTML + CSS is a million times easier than in native frameworks

I agree with your comment, except here: Doing layout in GTK is much easier than using HTML. Especially using Blueprint[0] you don't even have to touch .ui files. And constructing the GUI using code is possible, too.

At least the few things I did in HTML were a lot more difficult than they would have been in GTK.

[0] https://gitlab.gnome.org/jwestman/blueprint-compiler/


Yeah, but no one wants to look at GTK apps.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: