(Untitled)

Jul 19, 2006 15:03

Software Engineering Lession Number YOU-SUCK-MR-FORMER-PROGRAMMER:
When deprecating old code, UI objects, columns in data grid, remove the code. Don't set it to be invisible, column width = 0, etc. If you have to leave it in, LEAVE A COMMENT SAYING WHY.

Leave a comment

Comments 12

kiyoshi_05 July 19 2006, 20:09:42 UTC
Sheltim, I just wanted to let you know, you brighten my day.

Reply

locallunatic July 19 2006, 20:18:44 UTC
Yes your suffering brings us joy.

Reply

inmysocks July 19 2006, 20:52:12 UTC
lots and lots of joy
I am waiting for you to get AIDS so I can be even more joyful

Reply


dragoni82 July 19 2006, 22:19:34 UTC
// Don't know why we removed this function,
// except that it really improved the feng shui
// of the whole coding block.

Reply

kiyoshi_05 July 20 2006, 14:42:35 UTC
If that had been a haiku, it would have made it 5 billion times more awesome. This is what I will be doing from now on, making all my coding/scripting comments haikus.

Reply

tzarbomba July 20 2006, 15:41:26 UTC
I actually wrote a request for code review in Haiku the other day...
actually, our whole exchange following was in a series of haiku as well

Reply

dragoni82 July 20 2006, 17:54:56 UTC
This function is gone
and I don't know why, except
improved block's feng shui

Reply


tzarbomba July 20 2006, 15:49:03 UTC
Now, if we're talking about stand alone programs, I will agree with you on this. But, in the case of libraries, code should never be removed. Fixed, optimized, or refactored, but public methods or fields should never be completely removed.

Take the Java API for instance, much of it is depreciated (Date for example), but if they actually removed it, it would break all kinds of programs.

At the very least, old API should exist as mappings to new API.

Now, the exception to this rule is if there is a gaping security hole. In this case, I still wouldn't remove the methods, since that would result in a vague or even useless exception to be thrown, but rather have that method do nothing but print an error message or throw a more descriptive exception (depending on language you are working in).

Reply

sheltim July 20 2006, 19:21:13 UTC
I guess I wasn't clear on the situation. All of the code referencing this particular column, or check box, or text box, is gone. Except that it still exists in the UI.

Reply


pinano July 20 2006, 17:21:53 UTC
Eep. I think I was actually guilty of this one in the Audisey code, because I had (and still have) no faith in our source control, VSS. At the time, it was better to have dead code laying around than have to figure out how the hell to restore it from an old revision. VSS can't have multiple working directories, so you can't actually just go and check out the old revision and copy what you need -- MS expected you to do some formal "restore X lines from revision Y" stuff.

Reply

sheltim July 20 2006, 19:20:33 UTC
The source control for this project I'm working on is a folder on the network. Since the only people that edit code are myself and the guy sitting next to me, we use yelling at each other in lieu of checking in and out.

Of course, there's no real way to do versioning, but since I'm rewriting the application from scratch in a new language, it's not such a big deal.

Reply


Leave a comment

Up