Command Line Interfaces & Progressive Enhancement

A command line interface (CLI) is the baseline for a progressive enhancement approach to software development. But what does that mean and why is Bagcheck built this way?If you’re curious about such nerdy things then you should keep reading...

Defining Things

For those of you still here, let’s take a moment to define a few things so we are on the same page. A command line interface or (CLI) is a software interface that relies on text prompts to run operations and display their results. CLIs are the follow-on to punched card interfaces and the pre-cursor to the graphical user interfaces (GUIs) millions of people use on their Macs and PCs. To use a CLI, you simply write out what you want it to do. For example typing “print address 55” could retrieve the address stored with an ID of 55 and display it as “100 View St. Mountain View CA 94041”.

Progressive enhancement is a philosophy and technique for creating software that focuses on an essential set of functions which are gradually enhanced when the computers running the software can do more. So if a computer can display a button with smooth gradients and text shadows, it will. If it can’t, it will display the same text to the best of its abilities, which could be nothing more than a color fill. In both cases the text displays, and people can read it. But how “enhanced” the features are depends on what the device running the software can do.

CLI and Up

The Bagcheck Web site began its life as an application programming interface (API) with a command-line interface. We view each subsequent rendering of the site (desktop Web experience, mobile Web experience, RSS feeds, native mobile applications, and more) as progressive enhancements of this baseline experience.

The Bagcheck CLI allows you to do all the things you can do on the Bagcheck Web site: view bags, follow people, create bags, leave comments, and much more. The biggest difference is everything happens as text. Here, for example, is how you can follow a person using the CLI.

LukeW:~ lukew$ bagcheck follow followprofile 14

Really not much to look at is there? Here’s the same experience enhanced to the capabilities of Apple’s Safari Web browser and Microsoft’s Internet Explorer 7 Web browser. Notice a difference? We’re now in the realm of images, buttons, and styles. But the way things appear is different between the two browsers because they have different capabilities.

One can display rounded corners, text shadows, and gradients (Safari), the other one cannot (Internet Explorer). In both browsers, however, you can still follow someone you are interested in on Bagcheck. The baseline functionality works.

Why CLI?

We always add features to the Bagcheck API (and thereby command line interface) first. This provides us with a way to start using new things before we invest time in how they’ll look and work in a graphical user interface. In fact, the first bags ever made on Bagcheck were lovingly typed into the CLI character by character.

Obviously, we decided creating bags needed an easier solution than pure text entry. But starting with just the essential actions in the CLI gave us a great understanding of how bags could be created and managed in more capable situations. In fact, starting with the API and command line interface always forces us to distill things to their core essence and to understand them simply. What can go in and what will come out? That makes designing more enhanced versions of the same features much easier. We know what they need to do and why.

We’re always putting new ideas into the CLI and then figuring out how they can graduate to Web browsers and mobile devices. Because we don’t need a graphical user interface to start using features, we can try new things out very quickly and decide if they are worth “enhancing”. Even complex features like search started getting used in the CLI first.

Further Enhancements

In these early days of Bagcheck, we’ve really focused on speed of iteration and performance over completely polished solutions. As a result, we have nothing but opportunities for progressive enhancement moving forward. From Javascript fallbacks to responsive web design, as we keep making Bagcheck, we’ll look for new ways to enhance the site and make it work well in more and more places.