I love Kivy as well as QT. You can make some decent looking apps with the former and some incredible ones with the later. I have never personally worked with Electron.
But yeah, most devs use JS, HTML, and CSS for ui creation because of the Web.
I think something like QML could replace the html and css parts, though.
Um because a lot of them already know HTML/CSS/JS (because they've worked on websites). This the the major reason why Electron is popular - the barrier to entry is very low. That combined with the fact that users don't complain, just makes it a "pragmatic" choice.
I haven’t heard anyone outside of the hn circles moan about slacks usage.
- I'm a JS/TS developer, with it I can make CLI apps, websites, Electron apps and mobile apps. This means I can also use the same set of UI widgets I'm familiar with across all platforms, I can't do that with any other native UI toolkit so far, maybe the situation will change with the advent of WebAssembly, but so far JS has basically been the only language capable of providing this.
- I don't think I've ever used a Java GUI app that didn't look like crap and wasn't a game, I've also never made a GUI app in Java, so this is just a guess, but maybe it's just easier to make prettier apps with web technologies.
Personally, I liked it back in the Win95 days when everything used the native toolkit and I could change its appearance significantly through a simple control panel [0]. Back then, if I wanted a "dark mode" I just adjusted colors to make things darker, but with modern GUI bullshit it's a newsworthy item when someone adds "dark mode" as a feature.
Customizability-wise I actually prefer Electron apps to native ones, with a few lines of CSS I can remove stuff I don't need and tweak the UI a bit, I'm not quite sure you can do the same as easily for native apps.
Also you mentioned dark mode, an Electron app could support dark mode too, taking as an example macOS native apps they also have to explicitly support dark mode, so I'm not sure what you lose in this regard by non going native.
I would argue that going full-native win95 style has more downsides than benefits, for most people simply being able to change the wallpaper is enough.
That's a fair point. GUIs have tended towards being less customizable, not more, and that's a huge failure in my eyes. However, the customizability of Electron applications is really a side effect of the fact that it runs on top of a web browser. I find it difficult to count that as a point in its favor.
Looking at it from that perspective, there are native GUI systems that load XML files for their GUI that could also be called customizable by your standard.
Native apps use system colors by default. Electron apps tend to use static colors.
I've no idea how good Xamarin is at doing the things that it does, but even if I hadn't invested X into my web-based components Xamarin would still force me to reimplement them again in case I need them in my website. That's not cross-platform enough for me, Electron in better in this regard.
Also if it's not built in JS, it's not cool these days
To me, it feels like if you want to be cool these days, you look down on JS/JS devs.
JS has plenty of issues, but it's undeniably successful - isn't it more beneficial to either improve the problems or figure out why it continues to be successful despite them and adapt that in your language of choice rather than dismiss the success as being "cool"?
I've developed in a few languages, with JS being the latest, and while I do in fact enjoy it (mostly), it's not because I'm cool. I'm almost never cool, and being a JS dev involves people telling me that remains the case in tech forums regularly.
</rant>
All of my bitterness aside, your point about GUI development is completely correct. I've been happy to see CSS slowly taking lessons from desktop GUI layout and hope for more in the future.
The true hipster developer needs to be able to sneer at JavaScript with true derision while also having JavaScript be their go-to language for everything. Holding incompatible views at the same time about mostly inconsequential things is, after all, the true essence of being a hipster...
I prefer functionality over appearance, but I'm just a crusty old RDBMS DBA so I'm not sure my opinion can count for much.
So yes +1 cross platform GUI toolkit
If we could just get a modern UI lib w/ a C FFI you'd see a node wrapper and the complaints would reduce (yes I am aware of lots of efforts and could enumerate them all, but many are lacking).
I’m incredibly partial to Qt and love the framework (particularly the ability to style it and its C++/Python bindings). But even after making a small GUI application I can see why some would prefer more simple to use frameworks, whatever the resource or performance costs may be.
Ease of use? What's easier, MS Visual Basic/Embarcadero Delphi, or the application-oriented parts of HTML/CSS/JS? Even Python (which is freely available) is not exactly hard, and there are plenty of native apps using e.g. WxPython. It's not "ease of use", it's more like webdev "brogrammers" wanting to have their cake and eat it too.
It looks like Python is your only option if you want a community of any sort who is actually doing GUI development with a scripting language (Perl/Python/Ruby)
Because it very much feels like so, especially with tkinter. And it's not only the toolkit, it's the OS integration, and installer and so on. Because making a cross platform app with Electron is relative low effort and you get very good results. Most of the other options are not even close.
I think an updated, nicer ttk would help considerably, as well as a bigger widget library, but there is little information on improvements to Tk as a whole (I can’t even find enough examples for asyncio...)
Anyone have good references for either?
tkinter specifically does not look very pretty without some effort. I would much rather use GTK or QT. The problem is GTK support on windows is limited, and QT has a weird license model.
Qt is available under LGPL and GPL. What exactly is weird about that?
Up until 2005 or so Qt had indeed a relatively complex licensing scheme where the available (i.e. the license of Qt) and compatible (i.e. the license of the application, due to their GPL exception allowing applications to use MIT, BSD, ...) differed by what was then Qt ports (e.g. Qt/X11, Qt/OSX, Qt/Windows). After that they always had a uniform licensing model for Qt, were the licensing was independent of the platform.
I wanted to like Kivy but it was more clear how to get asyncio support running w/ tkinter. The Kivy folks say they will go to py 3 only soon and support asyncio officially soon but I am in a good place with tkinter.
I am also thinking about a 2-thread architecture which may work well for Kivy since it is so heavily Cythonized.
For me?
Because every API I access returns JSON, and because half those API have a JS package sitting somewhere in NPM.
Bonus, a large % also have typescript definition files laying around.
So my choice is either:
1. Deal with JSON in native, and create my own wrappers for every API out there, because next to no one publishes C/C++ libraries anymore.
2. Give in to the JS behemoth.
tl;dr ecosystem.
You have to parse it anyway, and in either case (native or JS) you'll be using a pre-built facility for that. Plenty of "native" languages can have good JSON support these days, and the "create a wrapper for the API" part is trivial if there's one available already, even if it's JS.
In JS you can just access the fields. With a lot of APIs just being HTTP endpoints, call fetch, get JSON, see if you like how it works.
Move over to a better NPM library that wraps it later on if so desired.
But for prototyping stuff, JSON+JS is stupid fast. JSON store DBs suck for a lot of reasons, but getting something working in them is incredibly easy.
Getting that something to "real product" is probably end to end more work than if a better tech stack was chosen. You win some and you lose some!
If you want to create custom elements I assume is simpler to do it in html with a couple of nested divs, background images and some css rules and some trickery and most probably your custom widget is not accessible and missing some nice features. As an example I know toolkits(Qt,Flex4) that can render huge tables of data, allow customization and are very efficient and you don't need third party libraries for that.
Lately I have been building apps with tkinter/python/asyncio and I can't get over how fast the apps are to load and to use. There is none of this "let's not respond to the mouse for 5 seconds" that is staggeringly common on my mac (particularly for apps like Safari and iTunes that come from Apple) nor the "go for a walk around the block" loading times for Java-based apps on my i7 Windows laptop.
True tk apps are ass-ugly but I find it mind-blowing to use GUI apps that are as responsive as Windows 95 apps were back in the day.