Programmers by Accident

Traditionally, a wide gulf has separated computer users from computer programmers. Users traditionally see computers as a means to an end, and learn only as much about them as they need to in order to solve their immediate problem. Users tend to use trial-and-error, or outright guesswork, rather than reading the documentation. Programmers, on the other hand, tend to see mastery of the computer as an end in itself. They abhor guessing, and think nothing of absorbing hundreds of pages of documentation at a single sitting. They spend years perfecting their craft, training themselves to think logically, to break down problems into manageable tasks, to code cleanly and clearly.

Because of the Web, though, those traditional distinctions between users and programmers have been blurred. The Web makes it easy for someone who isn’t a programmer to create useful collections of computer-based information. It also creates an upgrade path, a sequence of manageable steps that a programming novice can follow, with real benefits achieved at each stage. This is very different from the traditional route to becoming a programmer, in which one had to learn a great deal before being able to do anything useful.

A major factor in this upgrade path is Perl, the programming language of choice for web content creators. Perl is designed to be usable by mere mortals, people who haven’t spent years in a computer science lab. One of the design criteria that guided Perl’s creator, Larry Wall, was that with Perl, “Easy things should be easy, and hard things should be possible.” In this sense Perl is modeled on the natural languages that Larry, who was educated as a linguist, appreciated for their ability to efficiently express both simple ideas (“Give me the red ball”) and complex ones (“When in the course of human events, it becomes necessary for one people to dissolve the political bands which have connected them with another. . .”).

Like natural languages, one of the ways in which Perl makes easy things easy is that it is designed to let you get by using only a small subset of the language. As Larry puts it, Perl lets you talk baby talk, and in Perl such baby talk is officially okay. While there are those who argue that Perl makes a poor choice for a 1st programming language, it clearly makes a spectacular choice for a 0th programming language. By that I mean that Perl is an ideal language to learn if you are not now, and may never be, a full-time programmer because Perl, unlike other languages, will actually let you accomplish useful things almost from the outset.

There are some who believe that such amateurs, who are sometimes referred to as accidental programmers, have no business playing around with programming. A metaphor they sometimes trot out is that of surgery: “You wouldn’t want an amateur heart surgeon operating on you, would you?” This misses the point of the latest wave in computing, however. Delivering useful and interesting information via computer has become so easy in the age of the Web that the pool of content creators has expanded well beyond the ranks of professional programmers. Whatever purists may say, this is a good thing, just as it is a good thing that lots of non-physicians have been trained to perform CPR. The sloppy, unprofessional care these people provide saves hundreds of lives each year. In the same sense, even sloppy, unprofessional programming can do wonderful things on the Web. If some obscure piece of content you are interested in is available online, it’s probably there because someone who is not a professional programmer chose to make it available, and didn’t ask permission before he did so.

Of course, many tasks are beyond the capabilities of accidental programmers (just as there are many situations in which CPR, in and of itself, is an insufficient remedy). As Tolkien wrote in The Two Towers, “Perilous to us all are the devices of an art deeper than we possess ourselves.” As accidental programmers we must always be mindful of our own limitations, and should not hesitate to call in a professional if we seem to be getting in over our heads. That doesn’t mean we need to let the professionals have all the fun, however. We just need to do our best, as Larry Wall advises, to have “the appropriate amount of fun” (emphasis added).

Get Perl for Web Site Management now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.