Tuesday, September 18, 2007

Redesign the World

As a professional programmer, one of the things I constantly crib about is the fact that NOTHING fits my current requirements. No single tool, no open source library, no neat application, no nothing. I just get frustrated. Something that I want is automation. I don't want to be bothered with repeating something more than twice. I get all pissed because I have to do it. If its repetitive a computer got to do it. Why in the hell would I want to waste my time and effort??

Sometime back we were using Antlr as a Parser on our project. Given the simplicity of our grammar, we thought Antlr would be a perfect fit. But turns out, it was not! It was so painful that we replaced it with a hand written parser in about a day. With complete test coverage.

Given this attitude of "Redesign the one tends to redo a whole lot of things. The most important thing to keep in mind when you want to replace something that already exists and is very irritating is that it solves the problem. Doesn't matter if its not done well, if its slow etc etc. Because the chances are, by the time you reach where that tool/library is, you would have inadvertently ended up making some compromises or hacks every now and then yourself. Unless of course, there is a very strong reason such as the project productivity/velocity is getting screwed etc. to replace the tool.

What's more important is to be wary of what I call the "Quick-Win" syndrome. When you want to replace, lets say, Cruise Control or Selenium RC, its easy to get carried away thinking, "Its just a freaking while loop" and start off. The chances are you will get the basics quiet right, in fact may be better. But there are so many corner cases and issues that something like CC takes care of which were shielded from you that you just wont be able to "hack it" away to glory in a weekend. You will get a quick win in the sense that it works perfectly well in the happy path and feels Oh-so-close-now to the solution that you wont be prepared to give up until the contrived corner cases start biting you. But its just normal that you think its just one of those things or lets just hack this one away quickly which ends up in something "enterprise" like Selenium RC.

All I am saying is, when you want to replace something once and for all, don't think of it as a weekend hackday thing. Especially if its something big. So, take your time and make some wise decisions before starting off.

1 comment:

Swaroop Murthy said...

if only there was something like vbscript for things that are not made by microsoft :-)