Tuesday, February 02, 2010

Before sitting down to Eat the Elephant ...

In 'A Tale of Two Code Bases' I described two legacy code bases and how one (Project 1) was a pleasure to work on and the other (Project 2) was a nightmare. I promised to follow up with some hints for what Project 2 could have done to make their code more manageable.

About a year ago I was looking into wind generators and solar devices for my house ... it can get cold in Nova Scotia. The store owner told me "get your house fully insulated first, then we can talk about efficiency". Great advice. The same applies for Code Management. I think "The Joel Test" is a great litmus for whether your house is insulated enough. You shouldn't be struggling with bad source control/development tools, slow development PC's or perpetually looming deadlines before you go into this. You should also have some degree of buy-in from your superiors that you can regularly dedicate a little time to making your code base better. The intention is not to upset the apple-cart, boil the ocean or reinvent the wheel (choose your analogy) ... but rather Eat the Elephant.

I don't want to rehash topics that have already been exhaustively covered, such as TDD or the particulars of writing effective code in a given programming language. Well, I don't want to rehash them in any great detail. My intention is to make these posts about Effective Code Management and not about software development methodologies. That is, not about requirements gathering, feature definition, scheduling or estimating. I feel strongly that without a solid code management foundation whatever development methodology you use will fail over time.

So, I'll assume you've read one of the hundreds of TDD books out there and at least one of the "Effective [Foo]" books out there that apply to the programming language you use daily. C++/STL, C#, Java, etc. And, because I'm going to assume you will be working with code that is already in the field, I'll also recommend Michael Feathers 2004 book "Working Effectively with Legacy Code" which gives some nice guidelines for anyone faced with an elephant-meat diet.

Next time, we'll take our first nibble with a look at coding style guides ...


0 comments: