| « Classic WTF: Monitoring the Email Monitor | WasDogKicked? » |
"In late 2009, I started a new job at a large logistics corporation," Nikos writes, "it was on my first day that I learned that 'quality' and 'best practices' can mean vastly different things to different people. Within my first week, I learned that I should probably ask a lot more questions about the system I will be spending 8 hours a day maintaining. Within my first month, I started counting my days."
"I've kept sane over the past year by telling myself that, one day, I would submit this whole thing to Alex at The Daily WTF. But I was never able to do that. Not because I was afraid (I'm sure I could have redacted/anonymized the code just fine), but because there was no way I could figure out how to compress this entire company and system into a single, concise story. And that's when I remembered about the Representative Line series.
//Status (none, active, finished - default value is false) public String status;
"The more you look at the code and its accompanying comment, the more you understand how very, very different 'quality' and 'best practices' are over here."
|
Okay, so he made the status a string. Probably not the best option; I'd have used an enum or something. Also, it being a string with (I'd expect) a finite range of possible values, making it public probably isn't a good choice either. Words like "best practice" and "quality" certainly don't come to mind here. But I suppose it'll work, as long as no one abuses the unneeded flexibility of a public string.
I can appreciate that the comment lists the range of possible values for status (probably the only "best practice" shown), although my prior observations leave me doubtful of the comment's accuracy. So at this point, unless I'm missing something obvious I'd almost say that it's "not really a WTF". Except then I examine the following bit:
Someone please find this code's author and shoot him. |
| « Classic WTF: Monitoring the Email Monitor | WasDogKicked? » |