Jump to content

  • Log In with Google      Sign In   
  • Create Account

Best comment ever

  • You cannot reply to this topic
101 replies to this topic

#1   Members   -  Reputation: 658

Like
17Likes
Like

Posted 27 May 2014 - 10:50 AM

*
POPULAR

Okay, although this is not a code snippet, it can trigger your imagination about what we've been going through with this guy's code smile.png

This is the comment that I came across (obviously after another programmer fixed his mental code design and bugs)

 

// TODO BILLYPotentially improve programming skills


Edited by alkisbkn, 27 May 2014 - 10:50 AM.


#2   Crossbones+   -  Reputation: 7590

Like
14Likes
Like

Posted 27 May 2014 - 01:49 PM

*
POPULAR

You can find more at http://stackoverflow.com/questions/184618/what-is-the-best-comment-in-source-code-you-have-ever-encountered



#3   Members   -  Reputation: 351

Like
2Likes
Like

Posted 28 May 2014 - 12:56 PM

LOL :) golden


"Smoke me a kipper i'll be back for breakfast." -- iOS: Science Fiction Quiz

#4   Members   -  Reputation: 658

Like
30Likes
Like

Posted 09 June 2014 - 02:29 AM

*
POPULAR

/*

      .o.       ooooooooo.   ooooo      ooo   .oooooo.   ooooo        oooooooooo.   o8o  .oooooo..o      oooooooooooo       .o.       ooooo     ooo ooooo        ooooooooooooo 
     .888.      `888   `Y88. `888b.     `8'  d8P'  `Y8b  `888'        `888'   `Y8b  `YP d8P'    `Y8      `888'     `8      .888.      `888'     `8' `888'        8'   888   `8 
    .8"888.      888   .d88'  8 `88b.    8  888      888  888          888      888  '  Y88bo.            888             .8"888.      888       8   888              888      
   .8' `888.     888ooo88P'   8   `88b.  8  888      888  888          888      888      `"Y8888o.        888oooo8       .8' `888.     888       8   888              888      
  .88ooo8888.    888`88b.     8     `88b.8  888      888  888          888      888          `"Y88b       888    "      .88ooo8888.    888       8   888              888      
 .8'     `888.   888  `88b.   8       `888  `88b    d88'  888       o  888     d88'     oo     .d8P       888          .8'     `888.   `88.    .8'   888       o      888      
o88o     o8888o o888o  o888o o8o        `8   `Y8bood8P'  o888ooooood8 o888bood8P'       8""88888P'       o888o        o88o     o8888o    `YbodP'    o888ooooood8     o888o     
                                                                                                                                                                               





*/


#5   Members   -  Reputation: 220

Like
3Likes
Like

Posted 24 September 2014 - 03:15 PM

I once read through a piece of code of an open source project that was filled with

//don't even try to make sense of this

and

//get out whilst you can



#6   Members   -  Reputation: 10565

Like
18Likes
Like

Posted 25 September 2014 - 03:04 AM

*
POPULAR

From 3rd party code for a game I worked on;

// This is always 2
#define MAX_PLAYERS 3


#7   Members   -  Reputation: 5385

Like
2Likes
Like

Posted 25 September 2014 - 12:59 PM

From 3rd party code for a game I worked on;
 

// This is always 2
#define MAX_PLAYERS 3

Back when it was 2nd party code, I'm sure it was 2. =)



#8   Moderators   -  Reputation: 9442

Like
1Likes
Like

Posted 25 September 2014 - 01:16 PM

I sprinkle my code with such :
# (Coffeescript)

# TODO: derp, move this
numericSort = (a,b) -> a-b

# ...

# TODO: less huehue
ids = (_.pluckDeep models, '*.foo[*].bar[*].id').sort numericSort

gzip: H4sIAAAAAAAEAG1QTUvEMBC991e8nvaiFfYoS7yo sLCo6MnjtJ1ugmkiyWRL/72z3T1YEQIJ8z4zA2Xp yPvt1qBpGrRFIJZkk9FyRyUzHCbKIHgn4hnZOrm1 TD0mG0HCCs+QGDGWziKXI6Wm2n++GYwUVH2mrGEE PnGCVQ8K8+JYfXA6URDEQfMZh5h6g5eoAlWJdeEI bbH2qYZf7XMUfw8f/Q0oMeZYNL9/WHF0uFEshvMr XYujd9SycFb+F18QcSOvlJauZ8ejqevdnV7/d550 e0t6prmunh73Bu+vz4c/XUeOQXfJgvKNkhf95U8/ Dtgmy5IBAAA=

#9   Members   -  Reputation: 2113

Like
6Likes
Like

Posted 25 September 2014 - 01:18 PM

*
POPULAR

I always laugh a little when I found a comment like:

//TODO move this somewhere else

And it literally says "somewhere else", the original developer knew it was a bad place but didn't know where was a good place, so with that comment it's automatically fixed and pasted there forever. It's more funny when you find it in a codebase that's grown a lot over a few years and you think about how many people saw it and didn't want to take the risk of changing it, possibly introducing bugs. Also, it's even more funny when you realize you're one of them... it works there, there are bigger problems in the code, so it's not that bad. Anyway, it has a TODO comment, it will be done some time in the future... right?



#10 xoxos   Members   -  Reputation: 132

Like
1Likes
Like

Posted 17 October 2014 - 10:21 PM

hardly the best comment ever, but it acts like it..

      angle_x  = 0;                      /* Set X-axis angle to zero */
      trx      =  mat[5];                 /* And calculate Z-axis angle */

may not seem like an issue until you try to decomment that section of code...


neither a follower nor a leader behttp://www.xoxos.net

#11   Members   -  Reputation: 363

Like
4Likes
Like

Posted 27 November 2014 - 02:52 PM

These are hilarious. During my undergrad I was working on a partner project and found this in a 20 line .c file:

;;;;;  ;;;;;;  ;;      ;; ;;             ;;;;;;;  ;;;;;;;  ;;       ;;;;;;;  ;;   ;;  ;;;;; 
;;     ;;      ;;;;  ;;;;                ;;       ;;   ;;  ;;       ;;   ;;  ;;;  ;;  ;;   
;;;;;  ;;;;;;  ;;  ;;  ;; ;;   ;;;;;;    ;;       ;;   ;;  ;;       ;;   ;;  ;; ; ;;  ;;;;;
   ;;  ;;      ;;      ;; ;;             ;;       ;;   ;;  ;;       ;;   ;;  ;;  ;;;     ;;
;;;;;  ;;;;;;  ;;      ;; ;;             ;;;;;;;  ;;;;;;;  ;;;;;;;  ;;;;;;;  ;;   ;;  ;;;;;

Which much to my surprise compiles just fine.



#12   Crossbones+   -  Reputation: 2842

Like
1Likes
Like

Posted 27 November 2014 - 07:33 PM

Well d'oh, they're all empty statements, pretty much every language that uses semicolons to finish sentences supports them (I think the only exception is Lua). I have to admit though, when I saw that my first thought was that it was assembly (since semicolons are the usual comment character for assemblers).


Don't pay much attention to "the hedgehog" in my nick, it's just because "Sik" was already taken =/ By the way, Sik is pronounced like seek, not like sick.

#13   Members   -  Reputation: 363

Like
1Likes
Like

Posted 27 November 2014 - 09:27 PM

Well right, it just doesn't FEEL like it should!



#14   Crossbones+   -  Reputation: 2590

Like
4Likes
Like

Posted 28 November 2014 - 06:43 AM

These are hilarious. During my undergrad I was working on a partner project and found this in a 20 line .c file:

;;;;;  ;;;;;;  ;;      ;; ;;             ;;;;;;;  ;;;;;;;  ;;       ;;;;;;;  ;;   ;;  ;;;;; 
;;     ;;      ;;;;  ;;;;                ;;       ;;   ;;  ;;       ;;   ;;  ;;;  ;;  ;;   
;;;;;  ;;;;;;  ;;  ;;  ;; ;;   ;;;;;;    ;;       ;;   ;;  ;;       ;;   ;;  ;; ; ;;  ;;;;;
   ;;  ;;      ;;      ;; ;;             ;;       ;;   ;;  ;;       ;;   ;;  ;;  ;;;     ;;
;;;;;  ;;;;;;  ;;      ;; ;;             ;;;;;;;  ;;;;;;;  ;;;;;;;  ;;;;;;;  ;;   ;;  ;;;;;

Which much to my surprise compiles just fine.

(;) is a null statement and usually compiles to nothing at all.

 

A compiler I was working with for programming MSP430 microcontrollers would interpret a null statement as an actual NOP instruction. If I had pasted that thing into our code a lot of people would have been mad.


Edited by TheComet, 28 November 2014 - 06:50 AM.

"Windows 10 doesn't only include spyware, it is designed as spyware" -- Gaius Publius, The Big Picture RT Interview

"[...] we will access, disclose and preserve personal data, including your content (such as the content of your emails, other private communications or files in private folders), when we have a good faith belief that doing so is necessary" -- Windows 10 Privacy Statement


#15   Crossbones+   -  Reputation: 2842

Like
1Likes
Like

Posted 29 November 2014 - 01:12 PM

Hah. I imagine that in a microcontroller being able to insert NOPs makes sense though (since it's probably something directly controlling hardware).


Don't pay much attention to "the hedgehog" in my nick, it's just because "Sik" was already taken =/ By the way, Sik is pronounced like seek, not like sick.

#16   Members   -  Reputation: 360

Like
1Likes
Like

Posted 29 November 2014 - 01:51 PM

I ran across that stackoverflow thread years ago I think, and if memory serves my favorite (though there are so many gems in there!) was something along the lines of

 

// I'm sorry, I'm so sorry.

 

Sometimes I'm also partial to something along the lines of

// What kind of idiot wrote this?
bad code goes here
// Oh, it was me.

 

I'm rather satisfied by the fact that the company I work for has a revision control submission tracker thing that keeps track of what people think are the funniest submit comments.


There was a saying we had in college: Those who walk into the engineering building are never quite the same when they walk out.

#17   Members   -  Reputation: 1410

Like
1Likes
Like

Posted 30 November 2014 - 07:11 AM

... O_o ... are the commit comments supposed to be funny?


Edited by tanzanite7, 30 November 2014 - 07:12 AM.


#18   Members   -  Reputation: 517

Like
5Likes
Like

Posted 05 December 2014 - 09:59 PM

*
POPULAR

/**
* For the brave souls who get this far: You are the chosen ones,
* the valiant knights of programming who toil away, without rest,
* fixing our most awful code. To you, true saviors, kings of men,
* I say this: never gonna give you up, never gonna let you down,
* never gonna run around and desert you. Never gonna make you cry,
* never gonna say goodbye. Never gonna tell a lie and hurt you.
*/

This one made me lol pretty good laugh.png

One of the best comments I wrote was something along the lines of...
 

// Somehow multiplying what *should* be divided is what made this possible so DON'T TOUCH IT EVER

 

That was in one of my first games I wrote in DarkBASIC Professional. A formula that I used for centering the text manually in my own GUI library was supposed to use division for centering text, but it didn't work. Finally I just randomly tried multiplying it and it worked. To this day, I don't know why, I think it was just a total fluke. :P
 



					
					

My website! yodamanjer.com
My development blog!

Follow me on Twitter! @jwg1991
 


#19   Moderators   -  Reputation: 8596

Like
1Likes
Like

Posted 06 December 2014 - 09:53 AM


/**
* For the brave souls who get this far: You are the chosen ones,
* the valiant knights of programming who toil away, without rest,
* fixing our most awful code. To you, true saviors, kings of men,
* I say this: never gonna give you up, never gonna let you down,
* never gonna run around and desert you. Never gonna make you cry,
* never gonna say goodbye. Never gonna tell a lie and hurt you.
*/

 

Wow.  The rickrolling comment.  Awesome!


I think, therefore I am. I think? - "George Carlin"
My Website: Indie Game Programming

My Twitter: https://twitter.com/indieprogram

My Book: http://amzn.com/1305076532


#20   Members   -  Reputation: 1385

Like
2Likes
Like

Posted 18 December 2014 - 10:17 PM

Note to my future self:

// FIXME - I wrote this file at 4am, re-read EVERYTHING






PARTNERS