Yesterday I stumbled onto a delightful tool from Google Labs: Code Search.
Turns out Google is now crawling through source code. The GoogleBot, in its never-ending quest for sentience, searches inside tars, zips, and even dives into CVS and Subversion repositories. As Code Search is targeted at programmers, you can perform fantastically powerful queries using POSIX extended regular expressions.
Granted access to billions of lines of code and the awesome power of Google’s search technology, I did what any rational, thinking programmer would do: I typed in some profanity and hit enter.
In tribute to the valiant struggles of coders everywhere, please enjoy:
The best in programming profanity
/* Dear free software world, do you NOW see we are fucking
things up?! This is insane! */
# This job would be great if it wasn’t for the fucking customers.
# However, this only works if there are MULTIPLE checkboxes!
# The fucking JS DOM *changes* based on one or multiple boxes!?!?!
# Damn damn damn I hate the JavaScript DOM so damn much!!!!!!
/* TODO: this is obviously not right … this whole fucking module sucks anyway */
/* XXX toshok why oh *why* god WHY did they do this? no fucking
sense */
## fucking imap fucking sucks. what the FUCK kind of committee of
## dunces designed this shit.
# no, no, no, no, no, no, no, no
# no. fuck no. I am a fucking
# moron.
## aaahhh, user input. who would have though that such a simple
## idea would be SO FUCKING COMPLICATED?! because apparently
## Ncurses.getch (and Curses.getch), even in cbreak mode, BLOCKS
## ALL THREAD ACTIVITY. as in, no threads anywhere will run while
## it’s waiting for input. ok, fine, so we wrap it in a select. Of
## course we also rely on Ncurses.getch to tell us when an xterm
## resize has occurred, which select won’t catch, so we won’t
## resize outselves after a sigwinch until the user hits a key.
## and installing our own sigwinch handler means that the screen
## size returned by getmaxyx() DOESN’T UPDATE! and Kernel#trap
## RETURNS NIL as the previous handler!
##
## so basically, resizing with multi-threaded ruby Ncurses
## applications will always be broken.
##
## i’ve coined a new word for this: lametarded.
/* Holy shit, we just updated more than one row!
What do we do now? */
if (!(ptr = malloc (size)))
/* SHIT! SHIT! SHIT! */
die (“malloc failed”);
And my personal favorite:
# code below replaces code above – any problems?
# yeah, it doesn’t fucking work.
(Links are to the original sources)
Stay tough out there guys. Happy Monday.