This commit is contained in:
Miloslav Ciz 2023-02-26 21:42:34 +01:00
parent 43b3543ac6
commit 325284d58c
5 changed files with 11 additions and 6 deletions

6
gui.md
View file

@ -2,13 +2,13 @@
Graphical user interface (GUI) is a visual [user interface](ui.md) that uses graphics such as images and geometrical shapes. This stands in contrast with [text user interface](tui.md) (TUI) which is also visual but only uses text for communication.
Expert computer users normally frown upon GUI because it is the "noobish", inefficient, limiting, cumbersome, hard to automate way of interacting with computer. GUI brings [complexity](complexity.md) and [bloat](bloat.md), they are slow, inefficient and distracting. We try no to use them and prefer the [command line](cli.md).
Expert computer users normally frown upon GUI because it is the "noobish", inefficient, limiting, cumbersome, hard to automate way of interacting with computer. GUI brings [complexity](complexity.md) and [bloat](bloat.md), they are slow, inefficient and distracting. We try not to use them and prefer the [command line](cli.md).
GUIs mostly use [callback](callback.md)-based programming, which again is more complicated than standard polling non-interactive I/O.
"[Modern](modern.md)" GUIs mostly use [callback](callback.md)-based programming, which again is more complicated than standard polling non-interactive I/O. If you need to do GUI, just use a normal infinite loop FFS.
## When And How To Do GUI
GUI is not forbidden, it has its place, but today it's way too overused -- it should be used only if completely necessary (e.g. in a painting program) or as a completely optional thing build upon a more [suckless](suckless.md) text interface or [API](api.md). So remember: first create a program and/or a [library](library.md) working without GUI and only then consider creating an optional GUI [frontend](frontend.md). GUI must never be tied to whatever functionality can be implemented without it.
GUI is not forbidden, it has its place, but today it's way too overused -- it should be used only if completely necessary (e.g. in a painting program) or as a completely optional thing built upon a more [suckless](suckless.md) text interface or [API](api.md). So remember: first create a program and/or a [library](library.md) working without GUI and only then consider creating an optional GUI [frontend](frontend.md). GUI must never be tied to whatever functionality can be implemented without it.
Still, when making a GUI, you can make it [suckless](suckless.md) and lighthweight. Do your buttons need to have reflections, soft shadows and rounded anti-aliased borders? No. Do your windows need to be transparent with light-refraction simulation? No. Do you need to introduce many MB of dependencies and pain such as [QT](qt.md)? No.