Monday, February 5, 2007

"Hack bombing" is a horrible idea

I just read Oren Eini's blog post about "Hack bombing".
The basic notion is inserting time-dependant exceptions (set to trigger after a certain date) into the code instead of "To do" comments.
Oren is a great developer, constantly pushing himself to get better, but I think he took a step in the wrong direction in this case.

In a previous work place someone added an exception for his debugging, forgot about it, checked it into the source control and went home. Since he took the next day off, the rest of the development team had to put up with constantly getting a "bulbul" exception. (At one point a female developer declared "I got bulbul!" - this sounds very funny in Hebrew)

Whenever there is the slightest possible chance of your code leaving your personal computer, never insert UI meant for your personal use into it - in the worst possible scenario the customer may get a product containing this code.

If you may forget checking for "To do" comments, you may also forget running the section of the application you put the time bomb in before it reaches the QA.
And if you didn't get to your "To do" comments because you were busy doing something more important, using a time bomb will just force you to break your important task, replacing the time bomb with a "To do" comment and going back to that task....

Update: Oren responded to my post, writing his objectives for creating hack bombs:
1) Putting the bomb there makes it much more likely that I will remember it in time.
2) Actually getting hit by the bomb means that I need to fix it now.

Making sure you remember something is easy. For example, in the agile methodology Scrum you add a backlog item. A simple alternative is to create a new task in your Outlook.

Regarding the second objective, the hack bombs method sounds to me like going into a diet by telling your dentist to seal your jaw shut instead of striving to change your eating habits.
It means you don't trust yourself to make the right choice when the time comes.

Instead of forcing yourself to handle those task in advance, you should train yourself to record them and finding the time to address them voluntarily.


Anders said...

Tal Tikotzki said...

I cannot agree with Adi more, putting exceptions into the code is dangerous enough.
Using time-bombed exceptions is by far riskier. In the best case scenario you risk by loosing precious debugging time while in the worse case scenario I can think of, you risk by losing your client for "unstable" product.

Celia said...

This article is fantastic; the information you show us is very interesting and is really good written. It’s just great!! Do you want to know something more? Read it... Glass Bongs and Bong featuring Herbal Smoke, water bongs, bongs online head shop, Marijuana Alternative,glass water bongs, Hashish, Ganja, homemade bongs, Smokeshop, cannibis, legal smoking alternatives for herbal highs and aphrodisia.