DEV Community

What are some funny lines of code you've run/written into a project?

Andy Zhao (he/him) on December 21, 2017

Well, it's holiday season in the US and I've been gradually becoming less productive. I'd like to say it's because I have family over and that I ha...
Collapse
 
chiangs profile image
Stephen Chiang

aka the octothorpe...but octothorpe it is not nearly as funny as your version ;-)

Collapse
 
andy profile image
Andy Zhao (he/him)

Wow, I have never heard of that until now. What a name!

Collapse
 
ben profile image
Ben Halpern

Can't think of anything at the moment, but I've seen some cheeky comments from linters that make me double take.

Collapse
 
michaeltd profile image
michaeltd • Edited

My humble contribution to silly codes.


  do
  {
    cout << "DORMAMMU, I've come to bargain!" << endl;
  }
  while (!dormammu.bargain());

Collapse
 
michaeltd profile image
michaeltd • Edited

Also, Inserted this to a script header

# USE AT YOUR OWN RISK! IN CASE OF FIRE OR CATASTROPHIC FAILURE,
# CALL 911 OR OTHER APROPRIATE AUTHORITIES!
Collapse
 
remcowessels profile image
Remco Wessels

I recently put this comment // put hash in cookie in my code.

Collapse
 
hdennen profile image
Harry Dennen

In South Africa we have power issues which the government mitigates with "load shedding" - turning off parts of the grid during high load times.

Our app suffered similar high load call stacks causing jank, so I created a load shedding service that will spread computation across animation frames or ticks in order to keep frame rate at 60fps.

Collapse
 
thiruppathi profile image
Thiru
gulp jon-snow

jon-snow

Collapse
 
cathodion profile image
Dustin King

In a legacy Java codebase I was immersed in in my first programming job, I found this comment:

// Maybe these two lines will crush everything

Whatever code it referred to was no longer there.

Collapse
 
maccabee profile image
Maccabee

I'll definitely start thinking about it now. Though I work with a lot of non-native English speakers, so I'll have to be careful.

Collapse
 
glokicar profile image
Ivan Glo • Edited
case VK_F12:
    // sh*t goes crazy when you press this b***h (idk wai)
    break;
Collapse
 
jrf profile image
Josefina R.

This question reminded me of this: stackoverflow.com/questions/184618...

:)