Just sharing some of my inconsequential lunch conversations with you... RSS  

Monday, October 23, 2006

Please leave this line here

When I started working, I came across the following C code on the application I was maintaining:


// don't uncomment the next line
// strangely, it prevents a crash

sprintf (buffer, "");

I discussed that line with my team leader, that explained me that the application had been experiencing heap and stack corruptions here and there, and when adding debug, he found out that a simple (later simplified into an empty) sprintf would solve the problem.

My first thought was: "What kind of demented and irresponsible team leader would kept this without identifying the source of the problem?". The answer came with time: a pragmatical one. The application run years and years with the memory corruption, and the healing patch, and was finally terminated when the business it supported ended.

Don't get me wrong: I think that we should do whatever within our power to keep control over our applications. I still think his attitude was somehow reckless. But there are times when the proof of time defies the logic of the mind.

Thank god for garbage collectors...

No comments:

Development Catharsis :: Copyright 2006 Mário Romano