DEV Community

Ahmed Musallam
Ahmed Musallam

Posted on

Do you leave jokes in your code? If so, please share!

Sometimes, I leave bad jokes in my code, here are some examples from a backup tool I built a while back:

When a user tries to delete a backup:

console.log(`Still wanna do it? just checkin'...`)

When trying to remove a backup but something wrong happens:`ummm, yeah.. this is awkward; we could't delete the backups for some reason`)

When the user tries to remove a backup, but then cancels at the prompt:

console.log(`Whew, nothing happened. That must feel good, eh?`.green)

When something goes wrong:'womp womp... some error occurred *rolls eyes*')

Other times, I add a funny* comment to a funky looking piece of code, just because..

I am curious if other devs do it to, do you do anything like that? funny comments? funny method/variable names? or funny messages you show to users? please share!

*Depends on whom you ask ;)

Discussion (55)

teej profile image
TJ Fogarty

Oftentimes, my code is the joke 🤷‍♂️

boolie205 profile image


hdennen profile image
Harry Dennen

Given a long enough time frame, this becomes true for most code.

ben profile image
Ben Halpern

I tend to shorten button to butt, which seems clear enough, isn't overly offensive, but makes me chuckle just because I'm writing butt.

And even still I kind of regret not just writing button for clarity. 🙃

vlaem profile image

I use btn instead.
but I may start using butt from now on

fgiraldi profile image

Be careful on how you use your butt

patricktingen profile image
Patrick Tingen

At one client, they were using a home-grown issue tracking system called Bob, after Bob the Builder. It even had an image of Bob the Builder in the application itself.

As a little joke, I built in a timer that at random times replaced the image of Bob with one where one eye was closed, wich made it look like he was blinking every now and then. It took a week and a half before someone noticed. I had a hard time not to laugh and to keep my face straight, while asking: "what do you mean, Bob is blinking? Are you serious?"

ahmedmusallam profile image
Ahmed Musallam Author

This is gooood! 😂

cjbrooks12 profile image
Casey Brooks • Edited on

I also love the little gems hidden in the Android codebase

qm3ster profile image
Mihail Malo

What do the latter two actually do?

cjbrooks12 profile image
Casey Brooks

isUserAMonkey() is actually part of a testing utility. A "monkey" user does a bunch of random clicks and stuff trying to detect strange UI states.

The last one was just a joke, but it does check if GoatSimulator is installed

itachiuchiha profile image
Itachi Uchiha • Edited on

Our software which we use in the office, I leave a code like this:

const err = {
    count: 0

const btn = document.querySelector(".js-btn-remove")

btn.addEventListener("click", () => {
    if(err.count == 5) {
                // omg, you can't be serious. you're still trying...
                   title: 'Leave me alone...',
                   text: [
                      `Don't do this again. You almost kill me. This hurts me.`,
        return false;

         myFancyMessage('Warning', 'You are not authorized to remove sales.')        

    // some important codes

keinchy profile image
Frederick Jaime

err.count == 5? how did you come up with this number?

itachiuchiha profile image
Itachi Uchiha

5 is my favorite number. :P

No, it just an example. I just exemplified the scenario.

mercier_remi profile image
Rémi Mercier

This is precious! 😄

janpauldahlke profile image
jan paul • Edited on
//this should work, but...
//the night is dark and full of errors 
  onCheckBoxChange = (val: string ) => (_e: any) => {

    if (typeof this.props.updatePermission === 'function' && this.props.officerId && this.props.officerId >= 0) {

      this.props.updatePermission(this.props.officerId, {
        ...{ isValidAsPast : this.props.isValidAsPast, isValidAsUpcoming: this.props.isValidAsUpcoming},
        [val] : !this.props[val] } as PermissionPartial 
codemouse92 profile image
Jason C. McDonald

"The night is dark and full of errors."

How is this not a meme?

ahmedmusallam profile image
Ahmed Musallam Author

Hahahaha, this great! Might steal that from you ;)

bsalesc profile image
Bruno Sales • Edited on

I never did in products that I've worked, but where I work currently there are internal systems that when it's blocked for maintenance shows the Travolta confused :D And it makes me LOL...

Travolta confused

ahmedmusallam profile image
Ahmed Musallam Author

That’s awesome!

linevych profile image
Anton Linevych • Edited on

In the test case:

class OpportunityConnectionMessagesTestCase(APITestCase):

    def setUp(self):
        self.message_text = 'Last time I cried was when I was cutting Onion. Onion was a good dog.'

sixpeteunder profile image


sebastienkb profile image
Sébastien Kalb

I once copied code of my colleague Mark, including the Created by Mark comment. To fix this, I git-pushed:

I tried to frame Mark for a crime he didn't... commit.

kspeakman profile image
Kasey Speakman • Edited on

I recently used this code comment.

// Nonsense //
//   <reason why I had to do nonsense>

To clarify, I leave this in the code. The code had to be written to dull a weird edge of a library. It was odd in comparison to the rest, so I needed to explain. It is hoped that one day the weird edge will go away and I can remove the code.

hudsonburgess7 profile image
Hudson Burgess

I got fed up with badly written assignments in my last semester of college and left some comments criticizing the requirements 😛

elmuerte profile image
Michiel Hendriks • Edited on

I quite often use movie, and other pop culture, references. For example, in development and test mode pages include a Pi symbol in the lower left corner which shows some debug information when you click on it.

There have been cases where the final error message was PC Load Letter, if no better error message was available.

Or when resizing an array the comment // We're going to need a bigger boat is very suitable.

For an internal CA I used the department name Setec Astronomy.

molly profile image
Molly Struve (she/her) • Edited on

Our CTO once put a client into maintenance mode accidentally. When that happens, the client can't log into their account or anything. He panicked and started blowing up Slack asking about how to reverse it. Since then we have a confirm dialog on that button that says

Are you sure you want to enable maintenance mode for this client, Ed?

That was added over a year ago. What is better is that a newer dev recently saw it and assumed we had incorrectly identified the user. He was quite amused when we told him, nope, that was on purpose. 😂

codemouse92 profile image
Jason C. McDonald • Edited on

One of our developers, Scott, was well-known at MousePaw Media for possessing a lethally dry wit. I made the mistake of asking once for a "yay or nay" on something, and from then ever afterwards, he'd respond to yes/no questions with "yay" or "nay". It caught on at the company, even prompting a pair of yay-nay T-shirts to be made for our holiday gift exchange.

When we wrote IOChannel, a featureful wrapper around C++'s std::iostream, we offered a few formatting flags for printing boolean variables. Among those is the undocumented bool_scott...

bool foo = true;
ioc << bool_scott << foo << io_end;

...which would output...


Meanwhile, the official (still unpublished) specification for our upcoming language contains these little gems...

ERROR 22: Paradox. Something impossible happened.
ERROR 22: Paradox. Computer will now self-destruct.

Error 22 is actually useful for "can't happen" scenarios. There will be some way get it to print out the second message instead, though.

ERROR 42: Unknown question.
hdennen profile image
Harry Dennen

If a user hadn't used the new feature the UI needed to display a "new" icon next to it's menu link. so...

  let thaySeentIt;

  function init() {
    thaySeentIt = checkNewFeatureFlag();
andhop profile image
Andy Hopwood

I sometimes swear on mine

If(mybool === false){
   // Do f**k all
dallgoot profile image

Manyt times...
usually it gets removed at the end with the crappy code that caused the frustration :)

scrabill profile image
Shannon Crabill

On Twitter the other day we were talking about weird function/parameter names we had used in past projects.

This one wins.

At work, I don't really leave jokes in my code. On occasion, I had used Bacon Ipsum or Cupcake Ipsum for mockups. I used Riker Ipsum in conference slides which got some chuckles on Twitter

cjbrooks12 profile image
Casey Brooks

All of my mock data tends to be characters from Harry Potter, Doctor Who, or Disney. I've even written an entire library where everything is a reference to Harry Potter.

Also, my wife is a teacher and I built her a website to manager her gradebook, and used Huey, Dewey, and Louie for the test students. Her class got a kick out of it when they saw those names as she was showing them how to log on. 😂

vicoerv profile image

i thought you bring jokes to comment, but in user interaction?

moopet profile image
Ben Sinclair

I don't do this. It can come back to bite you in too many ways, such as

  • clients reviewing code and thinking you're unprofessional
  • clients thinking you're being rude about them (even if you're not)
  • bugs being harder to track down because your replacement is left searching a mountain of code for things like "whoops!"

I'm not saying I haven't done that sort of thing before; I just try not to do it now.

ahmedmusallam profile image
Ahmed Musallam Author

I see your point, and I get it. It really depends on your client and your work culture. Nothing wrong with being on the safe side.

fpuffer profile image
Frank Puffer

No. I never do that. Not that I have an issue with jokes. But you can bet that at least some users or other stakeholders won't understand the joke and instead view it as a lack of professionality.

ahmedmusallam profile image
Ahmed Musallam Author

Well of course! Context matters! I’m not talking about delivering jokes in products used by thousands of users (unless that’s part of your marketing strategy). Context matters, and I am usually careful about where the joke is placed and who’s going to read it.

In my specific case, this tool is open source, and is used exclusively by developers.

Additionally, I might leave a joke in a comment even in client code. I don’t think that’s going to be the reason a client thinks I’m unprofessional.

It goes without saying, inappropriate jokes have no place in this discussion. That’s just part of being respectful to other humans.

equinusocio profile image
Mattia Astorino

I use bootstrap

aldwindelgado profile image
Aldwin Delgado

I do put it on annotations using google annotations gallery. 😋

ahmedmusallam profile image
Ahmed Musallam Author


emrz profile image

Until march last year i worked maintaining a legacy insurance system, tech was Visual Basci 6 + T-Sql Stored Procedures.

Core product was from early 90s and was kept working by applying custom hacks for every customer since the beginning.

When i was about to quit, i was so stressed and angry all the time that i started leaving passive-agressive comments all around the code, not very matture from myself, but i needed to survive there.

I wish i had more screenshots from that time.

One day i inserted an ASCII version of Facebook's angry reaction at the end of a function

angery boii

I also remember writing Lasciate ogni speranza, voi ch'entrate on top of a really complicated and weird hack i had to do, it was something involving Ms Office automation.

Lots of the funny comments i have are in Spanish, so the joke is gone when translating.

But yes, i put a lot of weird/funny comments on code, the best part is finding it months or even years after.

shubhambattoo profile image
Shubham Battoo

Have a method for going back from a certain screen which spells , symondsGoBack, which is not that funny but a slogan during Indian freedom movement which is kind of odd.

phallstrom profile image
Philip Hallstrom

Awhile back I was legitimately able to return HTTP status 418 (I'm a tea pot) as I needed to trigger on something that I could guarantee wouldn't be caught by anyone else. That was fun :)

rvictorino profile image
Robin Victorino

makes me wondering if in our IoT era some actual connected teapot™ now responds a legitimate 418 in some situations

ahmedmusallam profile image
Ahmed Musallam Author

AH! I totally forgot about this status code! nice one! haha
For reference:

ievgenragulin profile image

I work on a fasting app where I named a function to clean up old fasts "deleteOldFarts" instead of "deleteOldFasts". Tried to pretend it was a typo. During a PR a colleague of mine asked me to fix the typo. I'm not a native speaker and I guess I didn't realize this might have been a bit too offensive.

tdubs profile image
Thom W

I used to troll people in code. You should move out to Cali! Missing you at work!

grmnsort profile image
Germán Rodríguez Ortiz

Whenever I leave a comment about flushing an entity manager, I'll Aldo leave a "also don't forget to wash hands :)" comment :P

oraclesean profile image
Oracle Sean ♠️

Is nawk installed?

function nawknawk () {
(nawk '{ print ; exit }' /etc/passwd) > /dev/null 2>&1
if [ ${?} -eq 0 ]
  then whosthere=nawk
  else whosthere=awk
reegodev profile image
Matteo Rigon

I just inject this
Usually before quitting my job.
And changing identity.

dougblackjr profile image
Doug Black

I add Silicon Valley quotes to every automated command in my app. Users never see them, but I get them in my log notifications, and it makes me smile and reminds me I'm alive.

ahmedmusallam profile image
Ahmed Musallam Author

I demand examples! haha

crongm profile image
Carlos Garcia ★

One of my hobbies was to leave snarky comments in commits that fixed dumb code... until my current employer had an issue with it. :(