Comment by rcxdude

13 hours ago

GUI development in general is quite complex. You _can_ in principle compose a GUI from even simpler components: keyboard/mouse/touch events and blitting pixels to a screen, but this leaves you to do almost everything yourself. This is not only more work but also means there's a lot less consistency from GUI to GUI.

In the olden days, you would be expected to use the UI toolkit provided by the OS, which was designed to provide a consistent and complete implementation of each GUI element, which not only made things easier to navigate for users but also provided things like customizable theming and accessibility features more or less 'for free'. Nowadays it's much more like a free-for-all, and every application is just a little bit different, sometimes on purpose, sometimes just by accident. Accessibility is a complete crapshoot.

The web is similar. The people pushing for using 'the platform' are trying to capture exactly the same set of advantages as the old-school OS UIs, as well as the additional complication that we have a much more diverse set of devices with UIs nowadays.

> In the olden days, you would be expected to use the UI toolkit provided by the OS

That’s still (IMHO) the best place to start.

This point came home recently in doing a little macro to load a directory of GeoJSON documents into QGIS.

You need to load the Python console to get the proper environment, and you can't just say logger.debug() to get a trace.

This is because QGIS runs in the Qt event loop.

Big cluebat: QGIS (qualitatively, and for the regular pythonista) is like doing everything via asyncio.

Ah, so: no wonder it's such a challenge.

  • Yeah, though I would probably paint this as a case where the logic of the application is very tied up the UI, which makes it generally quite difficult to access the functionality as a library (or e.g. from the command line). Some applications have things seperated out enough, but this is usually something you need to start with as a goal. Other applications do have a scripting interface which you can use to automate things, and this can work quite well, but sometimes it is still very tied to the UI (e.g. blender, where it is quite powerful but you are essentially still driving the UI from the commands instead of describing the actions you want. e.g. you need to change modes in order to perform certain actions).