Search code examples
user-interfacefrontendwysiwyg

Why is modern GUI development done using code and not a visual editor?


Twenty years ago I got hold of Borland Delphi 2 through a computer magazine. This was my first contact with programming and the visual drag-and-drop approach of constructing graphical user interfaces fitted me perfectly. Creating advanced GUI:s with the form designer was effortless and fun and even though I didn't end up as a developer I have been programming ever since.

Delphi 2 screenshot

Unfortunately it seems like the industry is moving away from visual GUI editors. In recent years I have implemented GUI:s using HTML/CSS, QT/QML, WPF/XAML and Android. My experience is that none of these technologies have visual editors on par with the one in Delphi 2 and what should be a visual task is better done using code.

Is this observation correct? If so, what is it about modern GUI:s that prevents them from being easliy constructed using visual editors?


Solution

  • The answer is already hidden in your question. HTML, QML, XAML, all these languages have an "ML" in the name, meaning these are "Markup Languages", not meant to describe an exact layout but the semantics of the content. Even before HTML this was not a new concept (see LaTeX for example), but it took a long time till the advantages of this approach got into the general consciousness. In fact HTML was misused as layout description language for many years (and still is in some cases).

    So what are the alleged advantages? One big difference to the heydays of Delphi is that we have to cope with vastly different devices, operating systems and screen resolutions nowadays. That's a harsh contrast to the 80s and 90s were we mostly had to cope with a small set of standard resolutions and widgets. Nowadays an App might be deployed on a wide range of different devices with vastly different screen formats and resolutions. Attempting a pixel exact placement doesn't make sense in this context. A tool which tries to maintain the notion of a pixel exact layout would just set wrong expectations and do more harm than good. It is far more productive to delegate the layout decisions to the corresponding layout engine of the platform.

    Doesn't that mean giving away control? Surely, but what the developer loses on control is what the user gains, which is arguably more important. This can make a huge difference to accessibility. Maybe some users don't even want a GUI? With this I don't even mean just people with disabilities (which is a often neglected userbase by developers and product managers), but also other computer programs, to make automation and integration easier. E.g. it's much easier to extract a specific text from a (well written) HTML document than it is from a PDF.

    Does that mean graphical tools don't have any use anymore? Surely not, but it can't be denied that much more time is spend with editing markup directly. But markup is declarative in nature which in itself has huge advantages over the imperative code we were forced to use to write UIs. I wouldn't even consider this "programming". Because of that even a compile step can oftentimes omitted which shortens the development cycle. So RAD tools essentially try to solve a problem here which doesn't even exist in this form anymore.