|
return0 posted:While I've got nothing as bad as that which has been posted, a colleague of mine was looking through some of my code and found something equivalent to this gem: What's wrong with that code? Is it just that code:
|
# ¿ Mar 22, 2008 04:03 |
|
|
# ¿ Apr 27, 2024 19:13 |
|
At my last job, we hired a guy who was supposed to be pretty good at...well...some technology. I won't say which, because you'd be able to figure out who it is. In fact, he was one of the coauthors of the O'Reilly book on it, so we assumed he really knew his stuff. Our product was written in Java, and he was supposed to write the section dealing with this technology. 2 days before we were supposed to code freeze, he's freaking out, saying that nothing works and he can't figure out why. I look at his code. First clue something was wrong: he's storing EVERYTHING as strings. Integer return codes? Strings! Boolean values? "True" and "False". Casting them to ints or bools every time he needs to use them, which is pretty often. Sometimes the casting was insane. I would see things like this: code:
code:
I spent the next 2 days and nights trying to figure out what the guy's code was really supposed to do, finding all the copy-pasted code, refactoring, and getting rid of the numerous unnecessary "factory" classes and abstract classes that he tried using in his failed attempts to get his code to work.
|
# ¿ Mar 22, 2008 22:30 |
|
Scaevolus posted:http://luke.breuer.com/time/item/MeditechCodeProcessor/318.aspx What's wrong with it? There's no way I'm going to make the mental effort to try to parse out what that regex does.
|
# ¿ Mar 29, 2008 22:53 |
|
nebby posted:Is that a lesbian porn button under the YouTube button? And why is there a Shakespeare button? Is that to solve the "million monkeys at a million typewriters" problem?
|
# ¿ Mar 31, 2008 23:06 |
|
That Turkey Story posted:Holy moly fucckkkk!!!!!!!!!! Uggg I just want to kill myself! Yuck! Two loving spaces? God dammit! Dude, whitespace changes can be incredibly annoying, and sometimes autocorrect functions don't work well.
|
# ¿ Apr 4, 2008 06:39 |
|
CT2049 posted:I understand what you mean, but that's not what's happening here. I'd get questioned for writing That's ridiculous. The first one reads like an english sentence; who could possible have a hard time reading it? It's like the difference between saying "my name is Bob" and "my name is Bob is a true statement".
|
# ¿ May 15, 2008 23:59 |
|
I'm fixing an application right now for a children's foster home. Previously, they went with the lowest bidder they could find ($20/hr, I think). That guy apparently subcontracted it out to someone who charged even less. None of them understood databases or DRY or much of anything. Here's some of their work:code:
code:
The PDF rendering code is broken up logically into "RenderPage1", "RenderPage2", and so on. So if I want to delete a section, everything has to be moved "up a function" to get the pagination right. I hate this codebase so much. The guys who wrote it have been working on it since last November.
|
# ¿ Jun 7, 2008 04:08 |
|
|
# ¿ Apr 27, 2024 19:13 |
|
qntm posted:This isn't really a coding horror, it's more of an absence-of-coding horror. What is the thought process that leads to an omission like that? I have severe problems attributing this to malice or incompetence, it has to be literally "I'm writing a program which lets people retrieve files and directories from remote locations. Oh, but not directories. I think I'll leave that bit out." I could see good arguments for making this a client responsibility. You keep the FTP protocol simple: only allow listing files and downloading one file at a time. Given those tools, the client can implement recursively downloading directories.
|
# ¿ Apr 16, 2010 18:04 |