DEV Community


Posted on

What Is The Worst Comment In Your Code?

Inspired by the thread Software developers of Reddit, what is the most shameful "fuck it, it works" piece of code you've ever written?, I wanted to ask what horrible/funny comments you have in your code.

In my main code base, 1000 lines in to a 2.5k line file, sits this beauty:

//================YOU ARE ENTERING HELL ON EARTH=======================
//======================THE PAIN STARTS HERE===========================
Enter fullscreen mode Exit fullscreen mode

I tried to refactor it once or twice, but I think I just got myself more jumbled as a result.

What signposts lie in the dark tunnels of your code to guide any unfortunate souls who had to venture that deep?

Top comments (15)

alex_takitani profile image
Alex Takitani
# bleeeee bleeeeeee bleeeeeeeeeeeeee -> isso foi eu vomitando enquanto fazia esse codigo

which translates more or less to

# bleeeee bleeeeeee bleeeeeeeeeeeeee ->  this was me vomiting while coding this.
chiangs profile image
Stephen Chiang • Edited
/* Why is it written like this? 
Now we're committed unless limitless
resources magically appear to afford
the refactor. Don't do this!
joppedc profile image
JoppeDC • Edited

I really loved this one, although its not from my project, rather from online :p
Exception up = new Exception("Something is really wrong.");
throw up; //ha ha

y0mbo profile image
John Uhri • Edited
  // TODO: this works 99% of the time
yorodm profile image
Yoandy Rodriguez Martinez
// To <Name redacted>: I will hunt you down and shoot you
// if you ever block an async call in this module again.
Enter fullscreen mode Exit fullscreen mode
dougmckechie profile image
Douglas McKechie

Years ago I remember being humored by the only comment in a very long Perl script; there were hundreds of lines with no comments at all, and about 2/3 of the way down the file there was a command which output some spaces to the screen with a comment on the end of the line "spaces".

print("        ");    // Spaces
Enter fullscreen mode Exit fullscreen mode

I believe my reaction was something like: really out of all the things you write a comment for it is the most obvious thing in the whole file? I showed some of my colleagues at the time and we all had a good laugh about it.

avalander profile image
Avalander • Edited

It's a classic I never thought I'd get to see in real life, but a couple of weeks back I found this gem.

// limit is 70
const limit = 50
sambenskin profile image
Sam Benskin

My favourite was this:

function sendSendmailMail

With the accompanying comment:

// Look, I don't even have time to name this function properly let alone write it
itsasine profile image
ItsASine (Kayla)
// TODO: This test is finicky; ignore its fails

I had this on a handful of tests that would randomly be like Expected 'long-ass string of content' but got '' though I think I fixed it today, so woo deleting todos!

adnanhz profile image
      Bad code warning :(
      [6 line explanation of why I wrote the code]

vguarnaccia profile image
Vincent Guarnaccia • Edited

Somebody added two comments to code written by another team member:

// Yuck... --<name redacted>
// Double yuck... --<name redacted>
themattyg profile image
Matt Graham

Anything with


in it

thomasrayner profile image
Thomas Rayner
// Will come back and fix this later

On a file that hasn't been touched in 3+ years. It's not very artistic or dramatic, but fffff....

owlgyle profile image

//plz come back and clean this up

ferkungamaboobo profile image
Doug R. Thomas, Esq.

In my big honkin WordPress plugin I built: