Victus Spiritus

home

Marvelous Throwaway Code is Mind Candy

19 Jan 2010

Writing good software libraries is hard because you have to make the code as close to bullet proof as possible. By bullet proof I mean elegant, reusable, fast, and few bugs. This is a terrible restriction for a first design. Throw away code could be the start of a library, but it has no requirement to be such.

As engineers or coders, the thing that we do most often is hack together code that is destined from the very beginning to be thrown away. There's a possibility of salvaging core utility but the driving "rule" is a balance of creative destruction. Many folks, like myself, learn by doing. The problems we choose provide both motivation and a framework for learning. In a real way the problems are the fundamental programming language.

The act of writing throwaway code (it's rarely designed) doesn't diminish the value of the software itself. The process is analogous to the first few strokes of an artist's painting, or the first few written paragraphs of a book (rarely the introduction). Getting something working is the mantra of throw away code. This driving priority trumps all other concerns. Its simplicity is its brilliance!

Why It's like Mind Candy

There are numerous psychological advantages to building throwaway code. It liberates the developer to go about implementing a task without concern for the longevity or optimal efficiency of the code. The act of creating throwaway code collapses down the design scope. It strips all the fluff of externalities, and what your left with is the ultimate flexibility to create. The mantra echoes the old Nike saying, just do it. The epoch of all great works starts with something too insignificant to be appreciated, the freedom to create something less than perfect. The utter rejection of perfection from the designers mind shatters the barriers to creation.