Friday, April 09, 2004

I don't feel liberated

I happened to glance through last November's Java Developer's Journal and there was an article about TDD. The author said when discussing writing tests before code, "This is a tremendously liberating thing to do." Is this the new buzz-word? I have seen this same word, "liberating," used in relation to TDD quite often. Did one of the priests of XP use the word "liberating" and now it has spread among all the minions? Do a quick search on Google of "liberating and TDD" and you will find lots of sites dealing with this concept. But among them you will find web sites that discuss TDD and are correct when they say, "liberating". Those sites aren't discussing another lame and overblown programming paradigm. Those sites are discussing "Telecommunication Device for the Deaf," something that truly is liberating.

I have to admit that I am not impressed with the hype surrounding test driven development. I have been using this type of unit testing since I was writing assembler programs on an IBM S370 in 1979. Of course, we didn’t have a fancy acronym for it. But then I am not impressed with the whole XP hype that seems to have lost the idea of what programmers are actually trying to do. We aren't trying to write perfectly refactored programs. We aren't even trying to write easily maintainable systems. We are trying to make profits for our company. (Something that all the dotcomers seemed to have forgotten about.) That means spending a few weeks of serious design to insure that an application really is cost justified. I once asked an XPer how he budgets a project. He really couldn't answer because since serious design and analysis is done during coding, all he does for his customers is give a rough estimate that is refined as the coding progresses. This means that the customer is buying something without being sure what he is getting or how much he is paying for it.

"Embrace change" is another mantra that is thrown around but this is exactly wrong. We want to control change, not embrace it. We need to analyze every change request and determine how it will affect the budget and schedule. The real paradigm that is good for a company is, "on time, on spec, and on budget". It seems like we have abandoned this for the concept that coding is the most fun so let's code. Producing pretty code might be fun and rewarding personally but every refactoring is costing money. Every day when two programmers are working on a program that one could do is costing money. Want to know why your job is being moved to India? Look around and see how much profit you are producing for your company. Your code doesn't have to be perfect it just has to make sense from a cost point of view.

I am reminded of a web application my group did for a real estate branch of a company I used to work for. The code we produced wasn't pretty but it was produced on time, on spec, and on budget. It has been running for several years and the company has earned several hundred thousand dollars in profit annually from the application. Could it stand a round of refactoring? Hell, yes! It could probably stand a complete rewrite. But why would you want to?

How is that for a rant? ;-)

No comments: