GUI vs CLI

 

Graphical user interfaces (GUIs) are exemplified by Microsoft Windows; command line interfaces (CLIs) by the Unix command language. There is a temptation to regard the CLI style as old fashioned, superseded by the GUI. There is a stereotype of the modern progressive user who favours GUIs versus the hardened hacker who will not use anything but a CLI. But this is too simplistic.

 

Clearly a GUI is easier for a novice or an occasional user than a CLI. Using a CLI requires expertise and, on occasion, reference to a manual.

 

Some types of application seem to be naturally visual and therefore candidates for a GUI. Examples are a graphics design tool, a web browser.

 

But GUIs are not scriptable. A CLI enables programs to be:

 

 

These are vital facilities in some applications and enormously useful in building software using existing components (programs).

 

Let us look at several examples.

 

Although a graphics authoring tool seems like a natural candidate for a GUI, there are times when a script or a CLI would be useful. For example, suppose we have constructed a drawing from a number of rectangles. Suppose we now want to thicken all of the lines that make up the rectangles. Using a GUI we probably need to select each of the lines individually to make them thicker and this could be a tedious task. This illustrates a general weakness in GUIs.

 

Novices can easily use a word processor such as Microsoft word. But when the document size is large, the incorporation of a mark-up language such as XML may make it easier to make large-scale changes.

 

Novice use of a database such as Microsoft Access can be facilitated using a GUI interface but for large scale use and access to a database by a program, SQL is more appropriate.

 

A GUI desk calculator is appealing and mimics an actual calculator. But it means that a calculation can be entered erroneously with little possibility for checking. In contrast, using a CLI, a calculation can be carefully formulated and checked. Further, a CLI calculator can accept input from another program and send its output to another.

 

Suppose want to change the file name extension from .txt to .java for a large number of files in a folder. We can do it using a GUI, but it is tedious. But writing a small script would probably be quicker - and more reliable.

 

The conclusion is that both types of interface are necessary:

 

 

The debate is summarised in the following table.

 

factor

GUI

CLI

ease of learning

easy

difficult

approach to learning

experiment

use a manual

ease of use

obvious

cryptic

scriptable?

no

yes

traceability

no

yes

good for repetitive tasks

no

yes

good for novices or for occasional use

yes

no

good for visual applications, e.g. web browser

yes

no

fast?

yes for novices

no for experts

no for novices

yes for experts