- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
He should be happy it doesn't return a self-defined boolean.
Admin
I'm dying to see exactly what such a monster of Cloverfield proportions was attempting to accomplish. And the three-line method Stephan replaced it with.
Admin
It needs a preceeding comment warning the reader to take Drammamine before proceeding!
Admin
Interesting, to say the least. Still wish we'd know what this was actually used for.
Admin
Did the writer (or should I say 'rider') win the white-and-red-dotted jersey that year?
Admin
Well shitfist me pink and fuck me rotting... I do believe this may be one of the first submissions that might be worse than the code written by a former co-worker of mine!
Admin
Not to mention that's 218 lines out of the "almost 700 LoC" method. So there's not much more than twice that again of "real" code.
The mind boggles, and not in a good way.
Admin
It looks like he missed The Tour De Finesse!
Admin
finally, indeed...
Admin
Finally, a representation of your average popular website's user ban policy in code form!
(I'm a Wikipedia admin and our policy is just a little bit more comprehensible, but... =)
Admin
If you tilt your head to the right it looks like a panoramic ascii art landscape :)
Admin
Admin
I bet it always returns FILE_NOT_FOUND
Admin
No shit, sherlock!
Admin
My current project is to port an old C app to Java, with no spec other than "take this, port it to Java." The old app looks like this, so I'm really suspecting that mine will too.
Admin
The World Anti-Doping Agency hereby informs you that henceforth all coders will be subject to random drug tests. It is obvious that nobody could possibly have written code like this without using banned substances.
CAPTCHA-- testosterone
Admin
I know how this happened. The author is a member of the Church of the Flying Spaghetti Monster and shuns the evil of boolean operators or the wickedness of polymethodism.
You guys should be ashamed of yourselves for making fun of his religion.
Admin
The reader must take drugs to get through this...
Admin
Perhaps a property getter.
Admin
The synchronized block wrapping the whole thing is probably very performant.
Admin
this reminds me of that old windows game where the guy skis down the slopes over hills and stuff... you know, the good old days, when movement was the arrow keys' job, not WASD...
Admin
That looks a lot like the code I wrote for my combat engine in High School!
Admin
Refactoring is kind of an unknown word for too much people :(
Admin
Never has the word 'finally' been more apt..
Admin
Give the guy a break, he's just not a big fan of composition..
</sarcasm>Admin
Admin
Did anyone run this to get the Cyclomatic Complexity?
Admin
Maybe it is because Java has no goto command and they were trying to make something with goto but they can't, so they are forced to do it like this instead.
Admin
I've never read "finally" in code with that tone of voice before.
Admin
Admin
First, this is really hilarious!
Second, I have to deal with code like this all the time Java classes for 3kLoC, methods with level of block inclusion 10 or higher. Just funny stuff.
Third, with most modern IDEs it is not so hard to write such code, but no IDE will help ya maintain it :(
Admin
Doping should not be prohibited in such a Tour de France.
Admin
If you tilt your head to the right it would land upon my shoulder. Go away, I'm not gay.
Admin
I've seen this kind of crap before at my old job. Some developers, when given a spec, don't bother actually trying to structure the thing and do almost a 1:1 transformation from English to code. For example, in a validation method that can return either true or false, it was pretty common for the damn thing to be 1000 lines long. Each condition in the spec was another if statement. You'd wind up with something like:
if(security.price > 100) // Case 1 { ..if(security.name == "XYZ") // special case for XYZ ..{ ..} } else // Case 2 { ..if(security.name == "XYZ") // duplicate code ugh ..{ ..} }
So, rather than try to organize the code in a way that actually makes sense, they follow the business rules to the letter and wind up with duplicated code all over the place and 1000 line long functions that are impossible to follow unless you've got the spec right in front of you.
Admin
0.o
Admin
It would be one line in C#
Admin
looks like someone doesn't know what methods/functions are...
secundum
Admin
Ok, somebody figure out the CC :) I don't really want to attempt to do it manually with THAT monstrosity but surely there are automated tools.
Admin
Admin
I like that it ends with finally. That's how you know it's over.
Admin
Its a foo property, obviously it returns bar.
Admin
It's a fractal. BFD. I write code that looks like the Mandelbrot set...
</math_joke>
Admin
Stick that thing on it's side and let's play Defender, baby!
Admin
If you scroll down it quickly, it looks almost like a strand of DNA...
Admin
This isn't much worse than Nethack's code.
Admin
The Cyclomatic Complexity appears to be approximately +INF.
Admin
Or looking for long term job security via code obscurity
Admin
Tour de farce, more likely.
Please tell me nobody codes like this. How the hell did they manage to get it to work?
Admin
If you can't code smart, you might as well obfuscate. Remember, obfuscation may not prove how smart you are, but it might just hide how dumb you are.
Admin
public boolean foo() { try { synchronized () { if () { } else { } for () { if () { if () { ......