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.
86 Comments
I did this recently too at http://www.koders.com (same idea), but the results were no where near as good.
It’s a funny thing, swearing in comments, really gives you the introspective insight into the coder.
A nice, eloquent snippet:
656: /* This is the fucking modify account dialog. I’ve fucking seperated it into
* three fucking frames:
* a fucking Login Options frame, a fucking User Options frame and a fucking
* Protcol Options frame. This fucking removes the two fucking tabs, which were
* quite fucking uneccessary. Fuck. */
Haha, gotta love this :) Almost fumbled out of my chair!
Try http://www.krugle.org/
It’s nearly the same and I like the ajax frontend.
Programming is sometimes so desperate…
I found:
// a random number per tick
static int st_randomnumber;
// Massive bunches of cheat shit
// to keep it from being easy to figure them out.
// Yeah, right…
aaah, this is great.
my coworker was prompted to go through my old code and found this:
<html and shit>
Fantastic, I’m dying over here!
What’s great about the
” Sun, you just can’t beat me, you just can’t. Stop trying,…”
is that it has a 1 in 4 chance of being written by Linus Torvalds. :)
I do this all the time myself, usually with stuff like:
$LeaveThisVariableSetTo1SoIE7DoesntFuckUp = 1;
But some other great ones I’ve found:
31: GODDAMN=`find . -name \*.pm -size 0`
if [ "$GODDAMN" ]; then
echo “Oops, some of the .pm’s didn’t get built properly!”
ls -l $GODDAMN
echo “Time to die. Goodbye!”
You can HEAR this guy grinding his teeth:
# Allow alphanumerics, plus the following:
# : [ ] ( ) – _ ! . ? ‘ ” ^ * $ | / \
# because people must have their goddamn smilies and so on. And
# then of course there are characters for pseudonyms already in
# the database (i.e., selectable from the popup — don’t want to
# have something selectable from the popup but then invalid!).
#
# Well, now it’s almost the entire goddamn ASCII table, so who
# cares?
if( $text =~ /[^\w\s:\[\]\(\)\-_!\.\*\?\’\”^\$\|\/\\]/ ) return undef;
Another Awesome one:
/* WARNING – this routine depends heavily on the */
/* fact that letters have been mapped into internal */
/* right-adjusted ascii. god help you if you */
/* have subverted this mechanism. */
And another
# Un-Goldy hack number #5 for the SuperCOSMOS catalogue, for some
# bloody stupid reason they’ve decided to label their magntitudes
# B_J, R_1, R_2 and I. God help me, if I ever find the guy responsible
# for this stupid idea. For now lets munge these here and cross our
# fingers.
And my FAV (This is all one program)
…
* IT A ‘PLOT’ COMMAND, (HE’S PLOTTING AGAINST US)
…
* PRINT STATEMENT, LET’S OUTPUT SOMETHING SO HE WON’T GET UPSET
* WHILE STAREING AT THE TUBE WONDERING IF WE DIED
…
* IT’S AN ‘INPUT’, LETS GIVE HIM A CHANCE TO DO SOME TYPING.. BUT
* KEEP AN EYE ON HIM, IN CASE HE TRY’S TO PUT SOMETHING OVER ON US
…
* LOOK’S LIKE HE CAN’T EVEN ENTER A SIMPLE NUMBER, CLEAN UP ANY STACK
* HE MAY HAVE USED, AND LET HIM TAKE ANOTHER BLIND STAB AT THE KEYBOARD
…
* DIMENSION, HE WANTS SOME ARRAY SPACE.. I SUPPOSE WE SHOULD GIVE IT TO HIM
…
* EITHER HE’S TRIED TO INDEX A NON-ARRAY VARIABLE, TRIED TO INDEX A CHARACTER
* VARIABLE WITH A VALUE GREATER THEN 34, OR HE’S PLOTTED OUTSIDE OF THE SCREEN
* NO MATTER WHAT HE’S DONE, GIVE HIM A NASTY MESSAGE SO HE WON’T DO IT AGAIN
…
* IT’S A ‘USR’ COMMAND, FIND OUT WHAT HE WANT’S, PASS CONTROL TO
* HIS MACHINE LANGUAGE ROUTINE, AND GOD HELP HIM IF HE SCREW’S UP
* BECAUSE WE CAN’T DO ANYTHING FOR HIM UNTIL HE RETURNS
…
* IF WE GET HERE, HE MADE IT BACK IN ONE PIECE
…
* IT’S AN ‘ORDER’, (HE THINKS HE KNOWS WHERE THERE IS SOME DATA)
…
Don’t tell me any of you HAVEN’T ever sworn in your comments or error messages before?!!
I’ve done this so many times that you’ll probably find some of my comments in the code search. Honestly; it’s especially when I’m fixing bugs and stupid browser or platform fixes that really annoy me do I start writing a pretty bitchy comment.
Also, I swear in my error messages; like PHP/SQL error messages, because I don’t really expect my server to crash and not allow me to select my database, so I just write funny error messages with a hella lot of profanity. It makes the job a little more fun.
Your lives would be easier if your attitudes were easier on each other, you know you are powerful and when you consistently powerfully destroy each other you all leave each other destroyed. Maybe no one has ever told this before but because you are powerful you might not want to associate with people that have those types of attitudes. It isnt good for you, it isnt good for them, and it isnt good for anyone really.
You do really amazing work youve brought us this far , there is no such thing as a deadline, when you get around to getting it done, it will be just what it needs to be.
Calm down and you might find your work will improve.
nicholas
1 513 312 5204
Ha! GREAT STUFF!
laugs all around.
thank you
Love This.
I think it’s even funnier when you see these kind of comments in O’Reilly books! :)
Look for yourself…
http://labs.oreilly.com/code/
That is seriously the funniest fucking thing I’ve seen on the interwebs in a long, long time (and yup, we’ve all done it) — the people in this coffee shop probably think I’m totally out of my mind rolling around laughing and spitting on myself trying to keep quiet. wow, THANK YOU!
hahaha..LOL.
this is fucking hilarious!
Damn! My esteem for programmers just went way way up. It gives you a whole new perspective on the fucking applications I curse everyday when I see the blood sweat and tears that went into the code…
Hilarious! Thank you for making my day easier to bear now…
I just busted my gut laughing so hard, literally fell off my chair, got shooshed from the misses and woke up my kid!
Hahahaha. The frust behind all that.
Its not just profanity that lurks in the depths of code, sometime its pure evil!
…….
Private Sub TheDarkFallenEvilEvilDuplicateMergeOfDoom666SatansLuciferSub(EnquirySQL, NonEnquirySQL, MatchSQL, MergeType)
‘ EVIL EVIL, infact SUPEREVIL routines for merging enquiry records into applicant records
Great post! Made me to remeber all stuff I wrote or tought about when was doing some things.
Thx m8!
My girlfriend just came into the room to discover me crippled over on the floor in utter tears and I was only half way down the page. Then I had to have her read the rest out loud.
Loved it all, but the fave is:
/* 2,191 lines of complete and utter shit coming up… */
…hahahahahahahahahaha…
Oh man. You just made my day. *wipes away tears*
At first I thougth you were just a slow/late adopter, because google has had the code search thing for a long time now. But your take on it was refreshing and funny. This is the second time in a week reddit has pointed me to your site. Keep up the good work. This post made me LOL, laugh out loud — for those late adopters.
Thanks for making my week! ;-)
/* FIXME: please god, when will the hurting stop? Thus function is so
fucking broken it’s not even funny. */
This is awesome.
Son of Bitch! I thought nobody would read my code.
Carmack has had some great comments.
Check the Quake source…
I remember finding a website that tracks the number of profanities in the linux kernel sources. Lol.
Hysterical. Leads to an interesting question: if you add comments like this into your code, they’ll definitely get read and people will spend the time to figure out what you are cursing, so would one consider this a possible best practice for programming? Most of them do explain why the code was written the way it was and some of them are quite entertaining…
Paul.
http://theprogrammersparadox.blogspot.com/
I haven’t (yet) sworn in my help source (I’m a technical writer), but I have put my name in, and one page of the big help I’m currently working on has “Muahahaha” commented into it somewhere. Only the Holy Avatar of St. Joseph Ossanna knows where it is now; that help file is about 450 (fucking) topics…
I wish now that I had been brave enough to leave those kinds of comments back when I was programming. LOL. I’ve been away from programming so long now though that comments are probably the only part of code that I still understand. heh. :)
Not exactly a code comment, but I bet it wasn’t for the general public…
I was shutting down a not-to-be-named UNIX machine, one of the last things it does is send a TERM (Please stop) signal to all running processes. Then it sends a KILL (I said, STOP!) signal to all running processes. All processes should be gone now and the box shuts down.
Except this one I had:
Sending all processes the TERM signal…
Sending all processes the KILL signal…
WARNING: Some processes refused to die!
Hey!! Found your blog on yahoo – quite some good info thanks but i still don\’t get it all, J.Sanders
Ahhh, swearing, pretty much the only (f#cking comfort which us programmers are left with….
Hello…Man i love reading your blog, interesting posts ! it was a great Thursday .
Indeed, as Mr. Homer says above it’s definitely a programming “best practice” to emote severely and often as you suffer through fixing some knothead’s code, or convolute reality and subvert the potential for concise coding beauty to meet some psychotic customer’s requirements. Excellent post; thanks for ID’ing the tool.
OMFGROFL that shit almost has me crying!!
quickie search… can’t believe this did not make your list:
ShitEntry::getShitLevel() const
{
return shitLevel;
}
I did not realize Google was now crawling through source code.
Google is a great search engine, but I am not ready for them to take over the world just yet!
This is funny as hell…
hahaha..
i like the “note to self guy”
It’s happened to me, i just write some shit up.. then forget how it worked..
nice compilation!
You mean that’s not how it’s done?? :-)
now, that’s some funny stuff!
I wish I had reasons to swear so much in my code.
Boy that was sure a funny read…
I’d like to see more of this :)
My favorite comment involved the word “between”, but I mistyped it as “betweek” and that segment of code got copied into every program in the company. That was 20-years ago. Every now and again, I make the same typo… and I giggle to myself!
Heh. Some amusing comments going on there. I think I’ve always managed to refrain from placing any profanities in my code, although there have been some close calls when our mock-up design work included some gripes about a client and nearly got sent on to the client by accident.
We stopped that pretty quickly!
Besides, most of our clients are alright. There’s just a couple of ******* ;)
Amen brotha!
This is hilarious. In an old DOS program where we had to do something called “skips” to print fields in the right place on the page, one day when I had to go into that code I found
// I HATE FUCKING SKIPS
// I HATE FUCKING SKIPS
// I HATE FUCKIGN SKIPS
I think the person who touched it last before me hated skips.
My contribution was a little more subtle. In one part of the code was a variable named “YAF” which someone translated for me as “Yet Another Flag”. When I couldn’t re-use that, I added “YAFF” – yep – “Yet Another Fucking Flag”.
Thats Fucking funny :D
*rofl*
/* If for any reason in this lame world */
/* this script doesn’t work */
/* DON’T send me email */
This is pretty hilarious. gg.
How does Google get into commented PHP code ????
This may sound like a developer’s version of an urban legend but I swear it’s true!
I recall one freelance developer that was working on a Flash website for a movie starring Jennifer Lopez, an actress he obviously had a low opinion of. He inserted some *colorful* messages into his debugger output and assumed they’d never be seen. He delivered the website, billed it and it went live on the Internet.
The next day, the studio was ringing his phone off the hook because they had been getting complaints about a variety of four-letter words showing up in people’s consoles. Yeah, some people out there in the “real world” have debug Flash players too.
If your source is public, mind your tongue. Your grandmother may read your code one day. If your source is not public, mind your debugger output. Your grandmother may install a debug player one day!
Hi from Donetsk, Ukraine. I am leaving comment here just to say thank you for this site, I am looking forward to reading more posts, hope it goes well, all the best, Jay.
I laughed, I cried, I practically wet my pants. Hilarious.
tried searching for “hate” ?
My all time favorite:
// Drunk… fix later
//set damage when I be shooted
lol hilarious man; gonna go and do some searches of my own…on code ofc not profanities!
Links aren’t working for me :(
wonderful think))
such a real story..
There si so interesting for us! Thanks!
Aamzing idea, grazie!
Where can I obtain larger information about this theme, except codeulate.cm?
5 февраля компанией «Полисет-СБ» будет представлена комплексная система безопасности под названием «Экспресс». Данная демонстрация пройдет в Москве в Выставочном комплексе «Крокус Сити», ведь именно здесь в это время и будет проводиться выставка «Технологии безопасности», тематике которой «Экспресс» полностью соответствует.
Теперь я скажу несколько слов о подводке к дичи молодой собаки и о ее стойке.(В работе собаки по дичи следует различать 4 момента (подразделения) ее работы:
1 — поиск, длящийся до того момента, как собака начнет причуивать признаки присутствия дичи в доступном для ее чутья расстоянии;
2 — потяжку — работа собаки, разбирающейся в донесшемся до нее запахе до момента окончательного определения ею наличия дичи; эта работа заканчивается
Where can i get this theme?
гут!сам частенько подобное придумываю…
Нелохо получилось. Есть ещё что-нибудь из этой серии?
У меня однажды такая же ситуация было. Довольно-таки красиво
Красиво получилось… Не знаю как остальным, но мне нравится. Кстати, как подписаться чтобы мне на электронный ящик приходило, если кто-то ещё оставил комментарий?
Привет. Образовалась проблема – прикупил я электродрель на магазин ру
А она сломалась у меня в тот ведь день – гарантии практически никакой не дали. Просто почта пришла с коробкой, а там все на китайском. Написал в торговый центр данный, дали ответ, что обращайтесь в сервис центр, но у меня ни документов на руках нет, ничего. Как можно приструнить этот онлайн магазин? Есть ли какие-то компетентные органы, что писать. Куда писать, кому писать. Сделал ошибку, да, нужно было в торговом центре нормальном прикупить, хотя нужной мне модели просто не было, да и подешевле в интернет-магазине. А вот теперь сижу у разбитого корыта. Подскажите, что делать.
Спасибо, много полезного почерпнул.
Отличный пост! Я читал с большим удовольствием. Теперь буду чаще посещать ваш блог.
огромное спасибо!
Я конечно мало что смыслю в посте но постараюсь осилить.
Big thanks…)
i have never laughed so much. Thanks for the post.
Graet Blog! Super!
Found what i was looking for!Thanks for the info guys!
Thanks for the source of profanity, I was reading these comments for a long time!
/* Holy shit, we just updated more than one row!
What do we do now? */
ooh my good …… plz kept doing update like this ….
Hey if it gets people interested in technology it can only be good. Maybe we should put sex in the code too, that will get people reading it more for sure.
35 Trackbacks/Pingbacks
[...] out some of the comments GoogleBot found in source code. BTW, GoogleBot is not searching and indexing source code as well! A [...]
[...] определённо, хит сезона суток — F*cking programming — google-поиск по открытым исходным кодам, перлы в [...]
[...] Codeulate – F*cking programming Haha! Google Code search reveals swearing in commented code. (We’ve all done it) /* 2,191 lines of complete and utter shit coming up… */ (tags: code comments google search funny) [...]
[...] F*cking programming : Codeulate.: haha, this gave me a chuckle, i could definitely insert some of them in the code i’m working on now. [...]
[...] http://codeulate.com/?p=7 [...]
[...] a blog post listing humorous occurrences of the word “fucking” in source code, courtesy Google’s Code Search. I found them hilarious — even if I don’t know the [...]
[...] F*cking programming : Codeulate. (tags: humor) [...]
[...] F*cking programming : Codeulate. (tags: programming humor) [...]
[...] Codeulate.com had a hilarious article about comments programmers make in their code. http://codeulate.com/?p=7 [...]
F*cking programming : Codeulate.
F*cking programming : Codeulate.
[...] The best in programming profanity (thanks, Reg). [...]
[...] Codeulate posted about swearing in the comment of programs. I laughed. Knowing some of the issues my programmers have with code and debugging, I can imaging that some of these comments are in their code. I’m going to have to send this link to some of them. Ah the things we do when we don’t think anyone else will see. [...]
[...] programmers handled difficult problems.. Or just provide you material to laugh at. Codeulate has a great list of comment swearing. I gotta say, I'm guilty of this too, but at least my anger isn't usually revealed to the [...]
[...] words on Google Code Search got old sometime last November, but Ben Orenstein has put together a hilarious collection of off color [...]
F*cking programming
I often do this. Writing what I really think in my source code comments. I decided to search through some of my current employers source code and found the following gem:
case “OptionSummary”:
SetUpOptionSummary…
F*cking programming : Codeulate.
Mit Google Code Search interessante Komentare in Source Code finden. Jeder der Code dokumentiert wird den einen oder anderen Gedanken schon mal gehabt haben.
[...] und was man dabei so findet: F*cking programming [...]
[...] F*cking programming : Codeulate. “Fuck me gently with a chainsaw” (tags: article blog blogs Culture development fuck fun funny geek humor humour list Nerds opensource programming Search software) [...]
[...] now, apparently Google is doing its own code sniffing, and some of the things people have found in the comments are truly hilarious. MikeSoja – December 29, 2007 — 11:47 pm. Filed under: [...]
[...] source AddThis var addthis_pub = ‘Jpjp’; ou Promouvoir via Additious L’art de rompre | [...]
[...] Often enough geeks and nerds are seen as not sufficiently expressing their emotions. But a look at their coding comments reveals a different picture [...]
[...] F*cking programming: “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.” [...]
[...] Hier noch weitere Kommentare none [...]
[...] up… */ und ähnliche schöne Kommentare aus verschiedensten Programm-Codes gibt’s unter F*cking programming bei codeulate zu lesen, sogar mit Quellenangabe. « Jason Molina beim [...]
[...] codeulate.com [...]
[...] [LOL] The best of programming profanity [...]
[...] Read more at http://codeulate.com/?p=7 [...]
[...] F*cking programming [...]
[...] hahaha [...]
[...] Sillybean, comes this wonderful link. (For programmers [...]
[...] Ben typed in a bit of profanity — one would assume he started with the f-word in its present participle form — and got some great results. [...]
[...] F*cking programming [...]
[...] present in Palm’s webOS code. While they aren’t as insane as the ones spotted by Codeulate (warning: NFSW), they are amusing and interesting in their own geeky way. While one developer [...]
[...] present in Palm’s webOS code. While they aren’t as insane as the ones spotted by Codeulate (warning: NFSW), they are amusing and interesting in their own geeky way. While one developer [...]
[...] http://codeulate.com/2007/12/fcking-programming/ http://www.kuro5hin.org/story/2004/2/15/71552/7795 [...]
Post a Comment