Motivating Students To Learn Command-Line Basics

Mar 11, 2014 • Atul Varma

I am in the position of teaching students who have had experience using scaffolded, user-friendly tools like Thimble to make user-facing interactive experiences. These students are already motivated to make cool things and understand the value of learning how to code, but they don’t necessarily realize that, in order to accomplish some of the things they want, they may need to use the command-line—an inscrutable “behind-the-scenes” tool that doesn’t have an obvious relationship to the end-users my students want to build software for.

With that, here is my rough draft of a pitch:

The command-line is a rather inhumane tool: its commands, their argument ordering, and option flags are incredibly hard to remember. Mistakes you make sometimes can’t be undone. A lot of what you can do could be done in a more intuitive way—albeit not usually a more efficient or composable way—through a GUI.

When you learn how to use the command-line, though, you’re not just learning how to use a tool. You’re also joining a massive community of innovators that have been building and sharing tools for the past four decades. If there’s something you want to build with programming, you can Google for it, but odds are that the solution will involve at least a little bit of using the command-line. It’s the lingua franca shared between virtually all coders, regardless of the language they program in, and this gives it tremendous utility in describing how we converse with computers.

Aside from that, the concepts you learn when using the command-line are quite useful in your favorite programming language, too: the concepts of files, directories, and relative and absolute paths are indispensable in virtually any language (including HTML and CSS). The notion of streams of data—represented on the command-line by files and pipes—is also quite common, and the notion of a program’s exit code isn’t dissimilar from the return value of a function. So aside from the community you’re joining, the increase in efficiency you’ll likely see, and access to the latest cutting-edge tools from the most brilliant programmers out there, you’ll also be learning powerful concepts that will make it easier to learn whatever language you set out to discover.

Also, once you get used to it, using the command-line can actually be fun. Like the time I piped the output of a text-based AOL Instant Messenger client to the input of a text-to-speech program, which allowed anyone to send my apartment a message and have it said out loud in my common room.