Writing Less Code
Tuesday, October 1st, 2002Tony writes about controlling software costs. One of the strategies he mentions for achieving this is writing less code.
I have been trying to think of times when I was encouraged as a software developer to write less code – and I’m not coming up with many examples. I did work on a project where we tried never to write the same thing twice – functions that we knew would be used in different parts of the system were neatly filed away into libraries and packages. But we never worried about the amount of code in these. It was perfectly acceptable for one of these functions to have hundreds of lines of code.
I also remember recounting a story about how Marty had managed to write a particular function in just three lines of code. The guy I was telling the story to said, “I thought Marty was a better programmer than that”. I replied that I didn’t think it was possible to write the function with fewer lines of code in way that wasn’t just line noise. But he didn’t mean that Marty should have written it in fewer lines. He thought that a good programmer would have used at least twenty lines of code for that function!
