Wednesday, December 21, 2011

Should You CLI?

In the beginning, computers were not really connected to users at all.  Programmers wired jumpers, and later fed stacks of cards.  When the connection came, it was with a line-oriented text interface.  First there were teletypes, and then there were CRT terminals.  The user typed, and the computer (programs) responded.  The user typed again, the computer responded again.  This command line interface (CLI) was in a very rudimentary sense "conversational."  Users couldn't ask anything ("sudo make me a sandwich") but if they learned the basic lingo of the computer, they could get a lot of work done.

Graphical user interfaces (GUIs) crept in, first on rare and expensive computers, but over time on everything down to a phone.  GUIs offer a more control-panel interaction.  It is look and click.  It is navigational.

There are many good reasons for programmers to be skilled at both modes.  A GUI has bandwidth and delivers massive amounts of information on a modern display.  On the other hand, the CLI conversation is a natural mode for performing a sequence of actions.

We can run a modern SQL database, like MySQL, from a GUI (or web-based) interface.  It makes it very easy.  On the other hand, there is no record or structure to the conversation.  When we connect to a database with a CLI client, we start conversing, and have a scroll-back history of every action performed.

When I connect as root to a production MySQL database, I do it with a CLI for this reason.  I can type once, and look twice, before hitting that sometimes scary "enter" key.

When I say "connect" I raise the second strength of the CLI.  It requires very low bandwidth and can be done with a telnet or ssh connection from one UNIX system anywhere in the world to another anywhere else in the world.  I've telneted across the office and (via a secure connection) to servers thousands of miles away.

You can do remote operations with GUIs, if they are set up, and if their crash isn't what you are trying to fix!  But the CLI will pretty much be there as long as a UNIX box is alive.  It is the ultimate fall-back, as well as a powerful tool for daily operations.

So yes, I'd say you should CLI (as well as GUI), but by all means Google "CLI versus GUI" for more opinions!

When you hit steps 4. Learn UNIX Basics and 9. Learn MySQL Basics value those CLI lessons.

No comments:

Post a Comment