DEV Community

What Is The Worst Comment In Your Code?

James on January 22, 2019

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...
Collapse
 
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.
Collapse
 
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!
*/
Collapse
 
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

Collapse
 
y0mbo profile image
John Uhri • Edited
  // TODO: this works 99% of the time
Collapse
 
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
Collapse
 
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.

Collapse
 
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
Collapse
 
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
Collapse
 
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!

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

 */
Collapse
 
vguarnaccia profile image
Vincent Guarnaccia • Edited

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

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

Anything with

¯\_(ツ)_/¯ 

in it

Collapse
 
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....

Collapse
 
owlgyle profile image
Owlgyle

//plz come back and clean this up

Collapse
 
ferkungamaboobo profile image
Doug R. Thomas, Esq.

In my big honkin WordPress plugin I built:

// USING $_GET IS $_KLUDGY_AS_FUQ