Some funny stories
Once I had a junior programmer writing VB code that needed to know the day of the week. He decided to write his own code, and read something like:
if (day = 1) or (day = 8) or (day = 15) or (day = 22) or (day = 29) then
weekday = "Monday"
elseif (day = 2) or (day = 9) or (day = 16) or (day = 23) or (day = 30) then
weekday = "Tuesday"
...
Trying to be educational I asked him for his opinion about his own code, and he said that he would simply modify it every month.
... and some angry comments
// Either the app is exiting or the world is coming to an end.
// Take your pick.
// I'd trade my office mate for a layout manager.
/* PB, is this right? -- AW */
// Everything is shamelessly stolen and rewritten.
// Feel the consequences of GPL ;-)
... and some hilarious errors
% tar cvf foo.tar
tar: Cowardly refusing to create an empty archive
In the middle of something innocuous, an angry message box appeared:
Dammit, Darin! I told you not to call me!
// TODO: Don't forget to write something funny and add a warning that some jokes (replace with: a lot of jokes) may be hard to understand for non-programmers.
// This text was posted by an automated script.
Also see The Daily WTF for more poor code examples!
ReplyDeletehaha, those source code snippets were amazing!
ReplyDeleteI tend to put funny comments in my code as well.
Once we were making a java class to handle errors in a card reader.
This one class was dealing with a card jam, comment to decribe it
/*Card reader got greedy*/
Its true though.
Thats only one of many strange comments i've added, not to mention code...
Favourite code on that page was:
; /* If you think this is a mistake, think again. */
I think thats pretty hilarious!
great! for much more funny source code comments -> http://www.codecandies.com
ReplyDeleteThat junior programmer must be an Indian
ReplyDeleteindians are far better programmers than others....
ReplyDeleteHi all,
ReplyDeleteI published first version of http://www.geakets.com where you can write funny code and let others discuss it.
I'm planning to have weekly competitions in future. Site is open sourced at github and I might need some design help. :)
@Mark : Y should he be Indian? Have you got something against the country?! Try looking up the staff records in Microsoft, Apple, Dell, Intel.. You name it.. You'll find many gifted programmers, many with patents to their names (which is Obviously more than you can claim for yourself!). So, try NOT to be a racist Pig.. which may be hard for a dick like you- but try anyway..
ReplyDeletei've had code written by indians. nothing special let me assure you.
ReplyDelete// Everything is shamelessly stolen and rewritten.
ReplyDelete// Feel the consequences of GPL ;-)
this is hilarious