Build One To Throw Away, You Will Anyhow

Such was one of the many pieces of advice of Fred Brooks in The Mythical Man-Month and while others of Brooks aphorisms have stood the test of time, completely scrapping a codebase is today seen more as an aberration than a painful but necessary part of the process.

Andrew Binstock, who’s been developing a modern typesetting language (a TeX for the new millennium), has decided to do just that with his 20KLoC, multiple man-year codebase. His recognition that “the more I code, the more I see that I am adding top floors to a leaning tower. Eventually I’ll topple it” may seem startling coming from a vocal advocate of unit-testing, especially to younger developers who probably have had pretty-good success developing Web-based applications.

Andrew pinpoints the critical issue:

It’s extremely difficult to figure out where your architecture is deficient if you have never done the kind of project you’re currently undertaking.

Nowadays, most of us do our professional programming in pretty well-worn niches — Web-based database-driven this, Smart-client semi-connected that, etc. Because of that, we (or our team) tend to make pretty good architectural choices. So good, in fact, that nowadays you don’t hear nearly as much concern about application architecture as used to be the case. So good, in fact, that lots of people think you can refactor your way out of the wrong architecture; Andrew’s decision is surely painful, but I think it’s vastly less painful than architectural refactoring.

Andrew seems to be heading towards re-implementing in Java, using NetBeans and Maven. I find that interesting, especially given his use of JavaScript as the internal command language. Why not go Rhino all the way down? Sheesh, Dan Ingalls friggin’ reinvented Smalltalk in JavaScript and Andrew would be able to hang with the cool kids at Google.

There are other good details in Andrew’s post and he promises to share other reflections as they occur to him — I’m sure his blog will be especially interesting in the coming weeks.