Avoiding the temptation to start over
I saw an essay on Rewrites Considered Harmful referenced recently on Slashdot. It reminded me of an article I read a long time ago from Joel Spolsky called Things You Should Never Do, Part I. Both have similar points and both cite the rewrite of Navigator/Mozilla as an example. (Note: I noticed in revisiting the Rewrites Considered Harmful article that he also has added a reference to Joel's original article). This is something I struggle with because 1) it can be so hard to read other people's code, and 2) I can always do it better ( :-) )
I have really noticed this urge to start over when dealing with NAnt scripts. Obviously I should start with a well constructed build script that is successfully building someone else's project right? Well maybe it is a flaw with the NAnt/XML format, but I find this virtually impossible. I've tried, but I end up stripping it down to an empty build script and building it up from scratch again. Is Fowler right, is XML a bad language for builds or am I just incompetent?
I plan on experimenting with NAnt's <include...> task to see if things can be encapsulated for re-use a little more. MSBuild's target files do a great job of this. Of course whenever you design things for reuse and flexibility you end up making them more complex and harder to use, causing the next person to want to start over again...sigh...will it ever end?