| When it comes to maintaining code, I believe there are 2 kinds of crap: subjective (I don't like it) and objective (it's crap because of these 14 specific reasons). You're probably right about people who inherit my code. I know, when they've whined about it, I confronted them. "Please show me exactly what's wrong with it. What are your specific complaints about violations?" I rarely got an objective answer. It was usually something about formatting, indenting, variable names too long, variable names too short, I'm use to it the way we did it (wrongly) at XYZ Co., something like that. True crap can be objectively identified by a violation such as: - variables named so that no one except King Tut could possibly figure out what they are - the same variables used for different purpose at the same time, usually in nested recursions - variables named with 1 or 2 characters - unassigned variables - variables initiated when they shouldn't be - division by zero - single entry, multiple exit (heavily maintained so that now outlying cases skip critical logic) - the same code in multiple places (only some of it maintained so that outlying cases skip critical logic) - endless recursions (for outlying cases only, naturally) - comments that don't agree with the code - data base tables with no definitions either in the schema or any code (my new favorite) I could go on and on, but you kinda get the picture. I wonder how many readers here have posted crap like this on their "wall of shame" at one time or another. It's funny the first 2^n times. Not so much fun anymore. |
I breath a sigh of relief whenever Microsoft breaks and old DLL's compatibility: when you can't push through for an upgrade, pray for Redmond to force it.
[Update:
``The hardware-specific accounting package''
This one is truly the "winar": plain-jane boring software that for some goddamn reason depends on that old Hayes modem, or this matrix printer. I have been hired to do this shit so often it's not even funny; it tends to sneak past the initial discussions. You tick off "GUI" and "ODBC" and you're on your way to start hacking, making a mental note about "ability to print". What you don't know is that, not only do they want to convert the old Access package to an intranet web app, but they also want it to print receipts using the "receipt printer" -- a custom made piece of pain that uses the parallel port for data, the serial for control, and two RJ45s to whistle the Danish national anthem on error. FUCK!]