This post originated from an RSS feed registered with Agile Buzz
by Laurent Bossavit.
Original Post: Good programming
Feed Title: Incipient(thoughts)
Feed URL: http://bossavit.com/thoughts/index.rdf
Feed Description: You're in a maze of twisty little decisions, all alike. You're in a maze of twisty little decisions, all different.
Good programming consists of three components: method, insight, and form. That's a rough conceptual framework intended for attendees of the Development Dojo - an idea I came up with a few months back and which is now becoming a reality.
The dojo is essentially a group of programmers, meeting for the purpose of becoming better programmers through practice, such as Kata. Nominally there are "students" and "masters", though that is problematic at this early stage, because we don't yet have a good way to tell who among us is more "advanced" in the craft of software development relative to the others.
I wanted to explain what the focus of the dojo would be; for instance, why we wouldn't be spending much time on the mechanics of TDD, or why algorithmic knowledge of deep elegance, a beautiful result from graph theory for instance, would also not be relevant. In my view, the point of the dojo is form, and it isn't either method or insight.
"Method, insight, and form" probably applies to a lot more than just programming. For instance, as yet another experiment into capturing the elusive quality known as "beginner's mind", I have taken up the guitar, and I see quite a few parallels.
You see, if you're going to teach something you know backward and forward - or even, actually, something that you're familiar with for a long time - you're going to run into problems because the people to whom you teach live in a different world from yours, with respect to what you teach. You probably can't even imagine what it's like not to know how to read; that's why teaching kids to read is frustrating at times, you have no clue what's going on in their heads as they stumble over a word that looks dead simple. That's why it's hard to teach object orientation, which you grok in an offhand way because you've been coding in C++ and Java for most of your career, to people who have a hard time telling a pointer from a struct.
Carving up the whole thing into three parts might help with understanding how it looks to a beginner, too:
Method has to do with how you go about your work. What systems or structures you have in place to avoid wasting time, ensure you work on the right thing, avoid mistakes, and so on. In guitar, I've found that practice is a major place for method. To get anywhere you have to practice sitting in the right position, you have to practice with a metronome, and so on. In programming, "method" has a fairly straightforward meaning - TDD is part of it, so is using CVS or some other version control system and having good discipline in its use, and so on.
Insight has to do with how you relate a solution to a problem, more broadly with how close you are to the core of things. In guitar, I suppose that "insight" is simply a sense of what is musical. I have scoured bookstores and the internet for information on "music theory" and the interesting thing is that no one is able to explain music; there are volumes of "systems" that sort of tie everything up together, notes, vibratory phenomena, scales, rules of harmony and so on, but no one can tell you in simple terms what makes a song sound catchy or a symphony sound inspiring. In programming, "insight" lies in the algorithms, in a sense of the structure of the problem and of the solution. Being able to prove that a given algorithm is O(log n) belongs in insight.
Form is what makes the execution good as opposed to the idea. I think it's unexpectedly more mysterious than the other two, although it has a number of extremely simple and plain components. In guitar, form consists in part of placing the fingers in the right places, that much I've got already. Don't ask me about the rest. In programming, "form" includes such things as not naming variables with two-letter names, using indents to improve readability, and removing duplication. But there's more to it than that. Insight is what you say with the language; form is the language itself - and language itself is quite mysterious. A lot of poetry, for instance, consists almost solely of form. When we look at a program and say, "Yeah, I can see that this thing works, but really what a lousy design", we're saying that it has bad form.
The point of Kata, and the point of the Dojo, is form.