The Best of the Command Line and a GUI

We are all very used to using a graphical user interface (GUI) theses days. Whilst purists would argue (validly) that the GUI existed before then, it became mainstream with Windows.

Even though I predate Windows, I have to agree that there are a lot of pluses that came from its adoption of a GUI. It certainly appealed to a much broader audience and it did so because it was easier for the general public to use. I don’t know if you’ve noticed but there are a lot more of the general public than us die-hards. You’ve probably also noticed that I’m a fan of “easier” so I do think it is a good thing.

The pluses are, of course:
– you can just double-click something and it opens in an appropriate program,
– you can copy something with just two ctrl-keystrokes (^C ^V),
– you can move files around just by dragging,
– you can see what something is with just a glance (its icon), and
– a lot of design / layout / drawing applications are more practical.

No doubt you can think of others. It does have a lot of pluses.

The Command Line

What we lost was some of the power and flexibility. MS would argue (equaly validly) that it is all still there in the Command Prompt. Indeed many of us do resort to using the command prompt from time to time. There may even be some people who spend more of their time there. I know on a unix / linux machine I’m more comfortable with a command line.

The command prompt gives you the greatest degree of flexibility. You can choose what program something gets opened in. You can decide what options apply. You can also string things together to run a set of programs in a given sequence.

You can do some of this in a GUI (right-click, Open with, More options, choose one, this time only) and you can hand-craft shortcuts to use specific options and probably also sequences. As you know, “Open with” can be a long process of choices. Hand crafting shortcuts can also be a long process of attempts. The command prompt gives you instant feedback if you mess something up. A shortcut has to be saved and clicked before you know it didn’t work. Often a shortcut just flashes up a window that runs (or did it fail?) and disappears. You’re better off getting it working in a command prompt first.

The drawback with a command prompt is that file paths are no longer short and simple. If you are in the right directory it isn’t so bad; but, where files are often in different directories, it can be hard to be in “the right directory”.

Take CmdTwain for example. The software is usually installed in a “Program Files” directory but users normally want the files it creates to go into a “Documents” directory. Yes, I have gone to some trouble to allow CmdTwain to find the bits it needs to run. This means you don’t have to be in its “Program Files” directory when you run it. You can be in a “Documents” directory. You would have to specify the full path to the “Program Files” directory though, or include it in the computer’s PATH.

No Clicks

The other benefit that the command line has is “no mouse clicks”. That might seem a strange thing to count as a benefit but with a GUI you have to put the mouse in the right spot and then click. It is very hard to make that repeatable without having to embed a human being into the middle of the system you are building. I am in favor of people having jobs but surely we want more interesting ones than “mouse-clicker”. The usual solution to this is to move the task to the user. S/he has to click the mouse. It saves having to supply a person with every copy of the software but it wastes the user’s time as they have to wait around to click something at the right time. How much of your life gets wasted this way?

The command line runs without mouse position information and clicks. Actions are repeatable. Noone needs to wait and then click something. It just runs. There’s something nice about that.

The Best of Both

What’s needed for advanced users is the ability to type in any command they want, with whatever options they want, to open any file with any program (Command line) but to not have to type in lengthy paths (GUI).

What’s needed for GUI users is a simpler command prompt where they can just type in simple commands and have it do things for them. They don’t know where they installed each program. They don’t know how to set up the PATH variable.

GuiCmd is a cross between the two worlds. It allows a programmer to setup easy commands (“scan filename”) for a user. It allows a programmer to use lots of different command line tools without having to add everyone of them to the PATH.

Leave a Reply

Your email address will not be published. Required fields are marked *