Tuesday, November 13, 2007

Programming as a Craft

Programming a computer is a skill many claim but few can actually do well. Like making fine furniture or fine clothes, creating a good program requires significant practice, knowledge, imagination, and skill. Programming is a modern craft, and to be a good programmer requires that you be a good craftsman.

I've been studying woodworking and the fabric arts, and I've discovered that being a craftsman in both of those disciplines requires a similar set of personal skills, attitudes, and perspectives. In fact, any handicraft would presumably require these same mental possessions, and a brief study of the Wikipedia list of handicraft trades confirms that. Each of these trades requires specialized knowledge of techniques and tools, best practices, a knowledge of the trade's history and the evolution of its products, an attention to detail, an eye for balance (or an abstract sense of balance) and proportion, etc.

A fine craftsman can see, either literally, or in his/her head, the perfection of a product's design. It's what words like symphony and concinnity describe. A beautifully crafted garment, like a beautifully crafted table, speaks to you, moves you like a powerful song or a poem. Of course to appreciate an abstract system such as a computer program in such a way, a person would need to have some knowledge of algorithms and discrete mathematics (perhaps you do already, but you don't label that knowledge with words like "algorithms" or "discrete mathematics"... it really all comes down to tools for working in logic).

You can be sure that all of the handicraft trades are practiced by a broad range of talents, from those who know little, but are not required to know much to produce a specific model or style of product for their market, to those who work purely as artists or perfectionists with no limits or expectations on their products, and everyone in between. The field of computer programming is likewise populated with a broad range of talent.

Most people I talk to have no idea that programming requires creativity, but it absolutely does. If you ask a person to build a box to hold something, think of the vast array of boxes that could be produced that would hold that thing, but some of them are beautifully crafted, durable, easy to use, perfectly fitted, and a pleasure to behold, while others are perfectly functional, but downright ugly, and still some may seem like they're barely glued together properly. Likewise a program can be beautiful or disgraceful.

Consider the user interface. Is it easy to use? Is it efficient? Is it free of bugs, reliable, able to withstand malformed input, always producing exactly the result you expect? Or is it kind of heinous looking, leading you to obscure screens that make no sense, sometimes not responding at all, and breaking if you don't do something just right?

Consider the longevity of the program. If the program was properly designed, it would be easy to improve, either by the original programmer(s), or a new person or persons who you have selected to handle the modifications. Computer programs are written in specialized programming languages. If they're well-written, they should be easy to follow by a programmer trained in that language. The functions and algorithms employed should demonstrate efficiency and simplicity. The program's structure should be well organized and documented. These things are invisible to the end user, but like superior joinery in a piece of furniture, or impeccable stitching in a fine garment, these things are what makes the program work properly, and poor attention paid to these details can ruin the whole work.

It is shocking to me how few people that call themselves programmers, and are paid to write computer programs, actually demonstrate good craftsmanship. Like Mr. James Krenov said so well in his book The Impractical Cabinetmaker, some people are paid for their quantity, not their quality, and so that is how they survive. There's a need for quick hacks just like there's a need for well composed systems. However, there seems to be a preponderance of hacks out there. Many programmers today are lazy. They don't take pride in what they produce, they just produce to meet a deadline and go home. I guess every trade has that, and maybe I only see it as a preponderance in programming because I work in the the early 21st century IT industry, where so many people have been pushed in to quickly learn how to do something well enough.

Thursday, November 01, 2007

Money

I've been reading an English translation of Rousseau's Confessions. It's an autobiographical work by a well known philosopher named Jean-Jacques Rousseau. I have not made it very far yet, and I've already stumbled onto one of those phrases that's so good it just makes you draw back and try to frame your own life in it to see if it fits.

To put the phrase in context, he writes for several paragraphs about his contempt for money, especially his inability to find anything but discomfort in spending it, and its nature of corrupting that which he attempts to obtain with it. He writes:

Money in one's possession is the instrument of liberty. Money one pursues is the symbol of servitude. That is why I hold fast to what I have, but covet no more.