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

Why is it that people seem to think using a cross-platform UI toolkit like tkinter, kivy, WxWindows, etc. is like putting their hand in a toilet?

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.




The aversion is mostly that a lot of devs have learned to use html, css, and js for styling ui's.

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.


To add to this point, virtually all software companies have devs with web dev experience that can be very easily leveraged with Electron. Native app development skills aren’t nearly as prevalent in most organisations in my experience. The success of electron has never been that much of a surprise to me: write once, ship (almost) everywhere, use the team you already have. Often cheaper than upskilling the team as well.


> Why is it that people seem to think using a cross-platform UI toolkit like tkinter, kivy, WxWindows, etc. is like putting their hand in a toilet?

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.


Basically this. Electron has a low cost/benefit. Yes some will not be happy with resources usage, but I doubt this is the majority.

I haven’t heard anyone outside of the hn circles moan about slacks usage.


I've made a few Electron apps, I don't use other cross-platform UI toolkits mainly for these reasons:

- 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.


It's easier to make GUIs that suit the developers own tastes with web tech than with real toolkits. Whether or not that is a desirable quality in applications is a matter of debate.

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.

[0] http://toastytech.com/guis/win95schemes.png


If you've tried VS Code, is it of desirable quality to you? If not why?

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.


> 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.

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.


VS Code uses almost as much memory as a full IDE but does less. Sublime Text does almost as much as VS Code and uses much less memory, loads large files much faster, and opens new windows instantly. The last time I checked, VS Code didn't support Services on macOS or standard menu keyboard shortcuts on Linux.

Native apps use system colors by default. Electron apps tend to use static colors.


How about Xamarin? It doesn’t give you a website, but it seems to cover the rest.


Well if I can't use the same UI components I spent years developing everywhere then this is a deal breaker for me.


It's a bit of a circular argument: "I'm invested into using X therefore X is a good choice". This tells us nothing about the quality of X, although I'm sure it means the world to you personally.


That's why I said _for me_.

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.


Why the downvote?


Pay no attention to the spurious "background cosmic radiation" downvotes, it averages out over time anyway.


My 2 cents is that tk apps look ugly AF as you mentioned and that GUI programming is a hard and thankless job... so people want to skirt around it by leveraging CSS which they already know.

Also if it's not built in JS, it's not cool these days


> 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.


> To me, it feels like if you want to be cool these days, you look down on JS/JS devs.

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...


The pervasive belief that how it looks is better than how it works. End-users can be conditioned to wait for the application to catch up if it looks nice. If it's ugly, most folks will simply lose interest.

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.


Do they think that? I think more what thing here is that Electron apps are popular with UI developers who want to make the jump from web apps to native apps without taking the time to learn the platforms, or wish to reuse components they use on their web apps.


I wrote one GUI app in PyQt, and (ab)used the ability to put keyboard accelerators everywhere. Combined with a menu system, the whole thing was as-fast-you-can-think, like vim, but well a GUI.

So yes +1 cross platform GUI toolkit


Because people don't want to write Python or C++ and I don't blame them. Why is it that people don't recognize that people don't want to marry an ecosystem for a UI?

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 think it’s primarily due to ease of use. Granted, I’m not an Electron dev, but I believe most “modern” developers would have an easier time writing a UI and application using HTML/CSS/JS, than a language like Python/C++/Java.

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.


> I think it’s primarily due to ease of use.

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.


Agreed! tkinter is blazing fast and frankly I don’t give a damn about the looks if it means I can solve problems faster and with less errors (ex when I keep a lot of data in my wetware memory).


I'm dealing with this same issue. One thing contributing to the hand-in-toilet feeling is that you go and look for tutorials, books, even documentation on Tk and how it works with any given language, and most of what you find is 10 years old or older. Nobody appears to be using the cross-platform toolkits, unless you count QT and/or GTK.

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)


> Why is it that people seem to think using a cross-platform UI toolkit like tkinter, kivy, WxWindows, etc. is like putting their hand in a toilet?

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’ve been tinkering along that same path (for small utilities that wrap CLIs and file manipulation libraries) and have used ttk for a “native” look and feel that isn’t quite right.

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?


> Why is it that people seem to think using a cross-platform UI toolkit like tkinter, kivy, WxWindows, etc. is like putting their hand in a toilet?

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 has a weird license model.

Qt is available under LGPL and GPL. What exactly is weird about that?


Looks like it's changed since I last looked into it. Probably a good option now.


Qt had been available under the LGPL since 2009.

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 have found installation of tkinter on Windows and MacOS is easy, which I can't say is true for GTK, QT or Kivy.

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.


Isn't QT LGPL now? That seems pretty reasonable.


looks like kivy will be a nice choice these days, actively developed, multiple platform, decent looking


> Why is it that people seem to think using a cross-platform UI toolkit like tkinter, kivy, WxWindows, etc. is like putting their hand in a toilet?

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.


> Deal with JSON in native

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.


> You have to parse it anyway

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!


Python also has lots of libraries. You can use Qt with JavaScript.


Check out pyqt, it's fast, cross platform, and super full of features


5 words: hot code reloading feedback loop


I tried to use QT with python, "I'm a big boy I can make native UI!" I said to myself... let's say I rather shoot myself than try QT ever again.


For simple UI you need to understand how layout works and then use the drag and drop designer. IMO is much simpler then learning and debugging CSS issues.

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.


Is much easier to understand CSS than QT designer, that gigantic generator of errors and wrong previews.


...and I have 5 years of professional experience as a JavaScript developer, yet I strongly prefer to write desktop apps and utilities with Qt (both PyQt and C++/Qt) than Electron.


You do you, I tried to make a simple list on PyQt and everything went wrong, a lot of signal issues, a lot of debugging compile issues, missing dependencies, wronly versioned dependencies despite downloading QT straigt from the site, never again going away from CSS and JS. And with flexbox and SASS is a pleasure to write CSS anyways.




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

Search: