1. 22
  1.  

  2. 2

    Are GUI builders really that useful? I did some GUI tools and a GUI app in the past and I’ve never understood what makes a GUI builder a better tool than just writing widget code directly in the editor. Assuming that the programmer creates a non-trivial application that contains GUI that is actually based on some state (shown/hidden panes, splitters, animation), is it really an advantage to have some windows in the GUI Builder, and some directly in the code?

    New GUI-oriented frameworks actually deliberately skip having a GUI builder (i.e. Flutter), and design their tools around writing the GUI in the code, and using the hot-reload pattern to instantly apply the code to a graphical output. So I’m wondering are GUI builders a pattern that is worth investing in?

    1. 7

      I used to feel the same way, but I’ve softened a bit. I’m now finding that putting the GUI purely in code has a bit of a bathtub curve to it. Like you, I find that GUIs that escape “Hello World” levels of complexity are often easier to handle in code than in a builder, since you hit a level of interactivity that escapes the model of the builder. However, as the GUI continues to grow, there’s often a growing amount boilerplate code for defining the GUI. Code that would be better expressed in a DSL. The breakthrough moment for me was realising that the native file format of the GUI builder can be that DSL. Now, depending on the builder and its format (some of which are truly execrable), you can get quite a bit of complexity before you reach the point where the builder is worthwhile. However, in the best case, reading the diffs of the builder files while doing a code review can be quicker and clearer than reading the diffs in the code, simply because you’re using a language designed for the job.

      1. 6

        One big advantage is iteration cycles, especially if you’re new to a GUI library. I’ve recently been writing a GUI app with GTK and rust. While I’m not new to GTK overall, I am new to GTK4 and some of the GTK3 the components I’m relying on. Waiting for rust linking between each iteration has been painful enough that I have considered switching to Glade. Unfortunately Glade’s support for the components seems perpetually less than full coverage. Whenever I try it I can only make about 80% of the GUI using the builder and then I have a mix of both approaches in my project, which can be confusing in its own way.

        1. 4

          I encountered the same slow linking as you, and fwiw I had great success leaning on mold as my linker: my change-rebuild cycle is less than a second.

          My windows builds are still slow (even with llvms linker), but I’m tempted to try this technique posted by Robert Krahn. Maybe it’ll make your situation much better.