Code research made fun
Totally hilarious some of the code snippets our friend G00gle finds, amazing how many people comment that their code (or some caveat of a language, or the weather) sucks.
We can probably find a ton of CodeSOD's and whatnot all over the place in just those results (approx. 5,000 results for that phrase).
Another good one:
And the classic:
Check out the 7th one down. Great for a laugh & 0.5!
BTW: Thanks to David in this post for clueing me in on the nifty G00gle code search.
ARGH! I hate not being able to edit my own posts!!!
Almost forgot to include the best one yet:
Helps you find that WTF-ey code (minus some common #ifdef jonx).
This aughtta keep Alex /Tim/Derrick busy on the CodeSOD's for quite a while...
You must be new here. We've had quite a few threads on this already.
i've been around for a while, just always musta missed this. highly amusing to me at this moment so i thought i'd repost it.
FWIW: someone should code an auto CodeSOD based on these search results. It could randomly generate background stories to things and then just stick some of the code it finds in the body... an Alex-bot!
long fuck = 99;
So that's the secret to getting a long fuck! Now if only we knew the units...
My Favorite. Maybe.
559: # by calling $self->type in a void context (which reblesses the object)
# and then calling $self->script again. I think this sucks, but then
# again this code shouldn't be called that often. Maybe.
What about these?
[url=http://www.google.com/codesearch?hl=en&lr=&q=%22what+have+I+done%22]http://www.google.com/codesearch?hl=en&lr=&q=%22what+have+I+done%22[/url] This one's my favorite
A lot of these seem to be coming from something called horde-groupware. Much less, from its XML handling. And it's nearing production (1.0rc1). Quick, we need to kill this before it sees daylight!
a good one for our friends across the pond (if you're stateside)
even better - thief!!!
I found some funny ones with this.
"I don't know why this works" - always a horrible feeling. Bad enough when you've just fixed a problem by poking at it until it goes away, but even worse when you realise that your code is horribly muddled and entirely wrong, but somehow still functions (case in point: I'm working on a (primitive) collision detection system, and one of my checks involved iterating over an array of coordinates ... except I forgot that they were stored in groups of three, so two out of every three coords would be entirely wrong. This would have been fine, if it weren't for the fact that my unit tests were still passing happily...)
Here's another good one: http://www.google.com/codesearch?hl=en&q=+"what+did+I+do"+-"what+did+I+do+wrong"&start=10&sa=N
Returned a diary of an insane coder, among other amusements:
"uigtk/uigtk.c: think i might stop coding soon... this is all
proving too much. right what did i do? ok i like updated the
todo file to say that i havn't updated the todo file, and"