Aug 31, 2008

Afraid of the CLI?

I found myself wondering recently (I wonder how many blogs I've started with a sentence similar to that) about programmers that don't use the command line. I know that outside of the geek world, people really like the point-and-click interface, and don't really know or want to know how to use the command line.

However, then I come to the question at hand. How many programmers are afraid of the command line? It is something that is fairly technical, but as programming itself is something that is also fairly technical, I don't see why a programmer should be afraid of it. Yet I do find programmers who don't know how to use it.

In Rails, I think that the command line is essential. The number of tasks that are done through rake mean that the most efficient way to sort through them all is through command line: just type the command you want rake to do and it does it. No having to dig through GUI screens and all that to find the one you want to do.
Same goes for the generators, by using the command line arguments you can save yourself a bit of typing later on by passing the right things to script/generate.

For web programming in general (I say programming to assert that you are actually programming and not just making HTML/CSS pages) command line is also important for productivity. When dealing with a server, you'll have to check log messages. While you can do this through fancy web interfaces, or by downloading the log files via FTP, the easiest way to do it IMO is through SSH. It's simple:
ssh username@domain.com
cd /path/to/log/file
tail -n 1000 logfile.log (add a -f in there if you want real-time updates)
You can do more magic using grep to find things more specifically what you're looking for.

So why would programmers be afraid of it? My answer is that it has a higher learning curve. You need to know things in order to use it. You need to know what commands to type, and what parameters to send to them. Not knowing how to use things like tail or grep or nano (not that nano is terribly difficult to use, but I can imagine some developers not liking it) can remove the efficiency boost that the command-line provides. Even worse, not knowing about --help/-h conventions or man pages make it even more difficult to figure things out.

I'd say this is another one of those things where taking the time to actually learn it will pay off in the end, but requires you to actually take the time to learn it. And it seems that in the modern computing world, taking time to learn how to use things is a no-no.

1 comment:

Anonymous said...

Maybe beginners could get some help over at codesnippets (Unix snippets)!

http://codesnippets.joyent.com