Jokes in Code Comments
-
Do you ever stick jokes in code comments through shear boredom or in the vein hope that one day, 2 years from now, the poor sop stuck with refactoring your code will get a tiny smile in his otherwise potentially painful day?
cheers, Chris Maunder The Code Project | Co-founder Microsoft C++ MVP
Always. Cause most of my code is a joke by itself :) I used to joke around at my former work place. And bad ones too. But that was because I hated the bastards. Now I don't do it. Maybe a slight pinch now and then such as:
public int SetJulianDatePosition(int position)//expects 69:)
I bug
-
Do you ever stick jokes in code comments through shear boredom or in the vein hope that one day, 2 years from now, the poor sop stuck with refactoring your code will get a tiny smile in his otherwise potentially painful day?
cheers, Chris Maunder The Code Project | Co-founder Microsoft C++ MVP
Frequently. Most recently with many a sarcastic comment in some terribly written code. My first was when I was first learning the noble art of code - COBOL no less. As part of the course I was sent on to learn COBOL, we had to write a small program (time dims the exact requirements, but we HAD to use at least one GOTO! So I wrote an entire program based on Monopoly. Understand it didn't play the game, but I had paragraphs called "ItsYourBirthdayCollect10Pounds", variables called OldKentRoad and Mayfair and (of course) a label "JAIL" just so I could have my compulsory GOTO read GOTO JAIL followed by a comment of "Go directly to jail, do not pass GO do not collect 200) I passed.
___________________________________________ .\\axxx (That's an 'M')
-
Do you ever stick jokes in code comments through shear boredom or in the vein hope that one day, 2 years from now, the poor sop stuck with refactoring your code will get a tiny smile in his otherwise potentially painful day?
cheers, Chris Maunder The Code Project | Co-founder Microsoft C++ MVP
-
Do you ever stick jokes in code comments through shear boredom or in the vein hope that one day, 2 years from now, the poor sop stuck with refactoring your code will get a tiny smile in his otherwise potentially painful day?
cheers, Chris Maunder The Code Project | Co-founder Microsoft C++ MVP
Does leaving sarcastic error messages for the users count? Would have been funny if they had been picked up in testing and/or QA, but alas; the users didn't think they were so funny.... :laugh:
-
Do you ever stick jokes in code comments through shear boredom or in the vein hope that one day, 2 years from now, the poor sop stuck with refactoring your code will get a tiny smile in his otherwise potentially painful day?
cheers, Chris Maunder The Code Project | Co-founder Microsoft C++ MVP
Not really, although I try to inject a little humour now and then when the opportunity arises, because I find reading source code written by others to be more enjoyable and relaxing when they do the same. :) It doesn't really count, but when I was tutoring Java programming to some beginning students in uni, I told one of the guys that slightly more comments (than none) might be helpful, at least when complicated things were happening. In the next mini-assignment he and his partner submitted code which looked like:
if(obvious condition 1) // Don't know what this does
a;
else if(obvious condition 2) // Don't know what this does
b;
else if(obvious condition 3) // Don't know what this does
c;
else
// Don't know what it does. I think it's some kind of fake breast for fathers...
d; -
Not really, although I try to inject a little humour now and then when the opportunity arises, because I find reading source code written by others to be more enjoyable and relaxing when they do the same. :) It doesn't really count, but when I was tutoring Java programming to some beginning students in uni, I told one of the guys that slightly more comments (than none) might be helpful, at least when complicated things were happening. In the next mini-assignment he and his partner submitted code which looked like:
if(obvious condition 1) // Don't know what this does
a;
else if(obvious condition 2) // Don't know what this does
b;
else if(obvious condition 3) // Don't know what this does
c;
else
// Don't know what it does. I think it's some kind of fake breast for fathers...
d;Had a friend at Northrop Grumman on JSTARS post a comment in his code "If you ever get here, your F*&Ked". A few years later, a Govie did a search for bad words. Good thing the programmer was one of the top WizBangs on the program, else he would have been fired. He was just given a repremand!
The Irishman
-
Do you ever stick jokes in code comments through shear boredom or in the vein hope that one day, 2 years from now, the poor sop stuck with refactoring your code will get a tiny smile in his otherwise potentially painful day?
cheers, Chris Maunder The Code Project | Co-founder Microsoft C++ MVP
From the project I'm working on right now: // Lieferanten gibt es nur in XML oder Vanille which means: Vendor (data) only comes in XML or plain vanilla
A while ago he asked me what he should have printed on my business cards. I said 'Wizard'. I read books which nobody else understand. Then I do something which nobody understands. After that the computer does something which nobody understands. When asked, I say things about the results which nobody understand. But everybody expects miracles from me on a regular basis. Looks to me like the classical definition of a wizard.
-
Do you ever stick jokes in code comments through shear boredom or in the vein hope that one day, 2 years from now, the poor sop stuck with refactoring your code will get a tiny smile in his otherwise potentially painful day?
cheers, Chris Maunder The Code Project | Co-founder Microsoft C++ MVP
-
Do you ever stick jokes in code comments through shear boredom or in the vein hope that one day, 2 years from now, the poor sop stuck with refactoring your code will get a tiny smile in his otherwise potentially painful day?
cheers, Chris Maunder The Code Project | Co-founder Microsoft C++ MVP
V saddened to hear about how some programmers approach jokes in code. What kind of shoddy coder doesn't? public boolean checkSomeThing() { boolean journey = false; // some code return journey; }
-
Does leaving sarcastic error messages for the users count? Would have been funny if they had been picked up in testing and/or QA, but alas; the users didn't think they were so funny.... :laugh:
Back around 2001, I was doing some OLE Automation with Word and VB. One of the defined errors was
-9 Other Error: See Manual
. So I looked it up in the manual by Microsoft and the definition given was exactly-9 Other Error: See Manual
. Since our practice was to catch and handle each error type, the message I gave to the user wasRTFM - Other Error. Contact Technical Support.
A couple of months later I had a user call me with the RTFM error. I had to mute the phone cause I couldn't stop laughing. -
Do you ever stick jokes in code comments through shear boredom or in the vein hope that one day, 2 years from now, the poor sop stuck with refactoring your code will get a tiny smile in his otherwise potentially painful day?
cheers, Chris Maunder The Code Project | Co-founder Microsoft C++ MVP
-
Do you ever stick jokes in code comments through shear boredom or in the vein hope that one day, 2 years from now, the poor sop stuck with refactoring your code will get a tiny smile in his otherwise potentially painful day?
cheers, Chris Maunder The Code Project | Co-founder Microsoft C++ MVP
When we were switching source repositories at a company with about 10 devs I had all the code on my workstation for the initial check in to the new system. I grep'd the directory and added ', The Wonder Pud' to every instance of one guy's name. He never thought to check it all out and change it back. Four years later I was back on contract for one month to help decommission the software and found lots of "John Smith, The Wonder Pud" all over the place.
-
Since no one will ever read my code but me, no. But when I did this for a living, I did it all the time! :-D I must say, though, that I am not the Master of this art; that was Gary Diehl, an engineer at General Dynamics I worked with once. We built military hardware there - missiles, primarily - and that stuff is always delivered with loads of paper. Manuals for support techs were big things, hundreds of pages long and printed on D-size paper. Gary was convinced that no one really ever read them so, in the manual for one of the Sparrow-series missiles, he wrote 3 or 4 pages of long jokes and buried them in the document. That 5 years or so before I went to work for the company, and by the time I left, no one had ever mentioned them. Apparently he was right, and no one ever reads the things. But I hope that over the years that manual and those pages served to brighten many a sailor's day. :laugh:
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
I think I heard about that! LOL... I heard the manual got printed too!
Know way too many languages... master of none!
-
Do you ever stick jokes in code comments through shear boredom or in the vein hope that one day, 2 years from now, the poor sop stuck with refactoring your code will get a tiny smile in his otherwise potentially painful day?
cheers, Chris Maunder The Code Project | Co-founder Microsoft C++ MVP
I put many bits of humor in my code but not so much jokes per se...
// Private Property Access Fields - you can't rely on these being available...
// one day I might just make them private and BANG your code won't compile!
// <evil laughing from over tired programmer... hahahhaha >
function read_item_saName: ansistring;Know way too many languages... master of none!
-
Do you ever stick jokes in code comments through shear boredom or in the vein hope that one day, 2 years from now, the poor sop stuck with refactoring your code will get a tiny smile in his otherwise potentially painful day?
cheers, Chris Maunder The Code Project | Co-founder Microsoft C++ MVP
No. If the code ever goes to the client this might give a really bad image of the company. Not a very good idea. It also looks unprofessional, even if the code won't leave the company. It might end up looking bad for you.
-
No. That wouldn't be the adult thing to do. From your question, I'm guessing you do.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith
As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
I agree. And depending on who ends up reading the code, things could get ugly.
-
Do you ever stick jokes in code comments through shear boredom or in the vein hope that one day, 2 years from now, the poor sop stuck with refactoring your code will get a tiny smile in his otherwise potentially painful day?
cheers, Chris Maunder The Code Project | Co-founder Microsoft C++ MVP
Sometimes I have wrote in the header of a sp or function a comment like this:
/**** * If this code works properly, it was developed by _ME_. * Otherwise, it was developed by _JOE_. * And if you want to report any issue with this, please refer it to _JOHN_. ****/
And usually "JOHN" doesn't exists, or not longer works with us. :cool: -
Do you ever stick jokes in code comments through shear boredom or in the vein hope that one day, 2 years from now, the poor sop stuck with refactoring your code will get a tiny smile in his otherwise potentially painful day?
cheers, Chris Maunder The Code Project | Co-founder Microsoft C++ MVP
I once worked with an American guy who used swear words for his variables. When he'd run out of them he'd go on to profaning characters in literature, such as (not with asterisks, of course): boolean GandalfTheF******T*** = False; or string FrodoIsAnAsshole = "Please select from the following options: "; He worked quickly and accurately and, although he could be very prickly with the management, he was considered to be such an asset that no-one ever ticked him off.
-
Do you ever stick jokes in code comments through shear boredom or in the vein hope that one day, 2 years from now, the poor sop stuck with refactoring your code will get a tiny smile in his otherwise potentially painful day?
cheers, Chris Maunder The Code Project | Co-founder Microsoft C++ MVP
-
I once worked with an American guy who used swear words for his variables. When he'd run out of them he'd go on to profaning characters in literature, such as (not with asterisks, of course): boolean GandalfTheF******T*** = False; or string FrodoIsAnAsshole = "Please select from the following options: "; He worked quickly and accurately and, although he could be very prickly with the management, he was considered to be such an asset that no-one ever ticked him off.
There's funny, and then there's just stupid.
cheers, Chris Maunder The Code Project | Co-founder Microsoft C++ MVP