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:
spinner.fail(`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:
spinner.fail('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 ;)
Latest comments (54)
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.
Is
nawk
installed?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 :)
makes me wondering if in our IoT era some actual connected teapot™ now responds a legitimate 418 in some situations
AH! I totally forgot about this status code! nice one! haha
For reference: developer.mozilla.org/en-US/docs/W...
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.
I demand examples! haha
I used to troll people in code. You should move out to Cali! Missing you at work!
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++'sstd::iostream
, we offered a few formatting flags for printing boolean variables. Among those is the undocumentedbool_scott
......which would output...
Meanwhile, the official (still unpublished) specification for our upcoming language contains these little gems...
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.
I use bootstrap
If a user hadn't used the new feature the UI needed to display a "new" icon next to it's menu link. so...
On Twitter the other day we were talking about weird function/parameter names we had used in past projects.
This one wins.
twitter.com/saronyitbarek/status/1...
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
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
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. 😂
One of my hobbies was to leave snarky comments in commits that fixed dumb code... until my current employer had an issue with it. :(
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
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.
I just inject this github.com/kitcambridge/evil.js/bl...
Usually before quitting my job.
And changing identity.
Whenever I leave a comment about flushing an entity manager, I'll Aldo leave a "also don't forget to wash hands :)" comment :P
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.
Some comments may only be visible to logged-in visitors. Sign in to view all comments.