• (nodebb)

    This article needs to be commented, or deleted.

  • Simon (unregistered)

    Wasn’t there a famous one "You are not meant to understand this"?

  • Officer Johnny Holzkopf (unregistered) in reply to Simon

    Along with the official documentation that said: "Nobody wants to say how this works. Maybe nobody knows."

  • (nodebb)

    My favorite comment was 'Store AX register'. What made it special was that the code was 68000 assembler which does not have an AX register.

  • (nodebb)

    One of my professors told us about some code he worked with that only had one comment in it: "Turn the bugger on". He had no idea what the bugger was or what was happening that would be turning it on.

  • Duke of New York (unregistered)

    To be commented or deleted. That is the ?.

  • Dan Swartzendruber (unregistered) in reply to Simon

    I seem to recall the comment was "You are not expected to understand this" and was from the bowels of the original UNIX kernel...

  • Dr, Pepper (unregistered)

    Our company has a policy that all methods must be documented. Fortunately, the documentation is not code-reviewed; and fortunately GhostDoc can auto-generate the comments; so there are many methods documented like this:

    ///

    /// Noes the query results. /// /// <returns></returns> [HttpGet] public ActionResult NoQueryResults(string q) ...

        /// <summary>
        ///     Restrictions the error.
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public ActionResult RestrictionError()
    
  • (nodebb) in reply to Rick

    Yeah, I once saw for a 286 assembly listing a comment about "accessing the zero page". Ah, that throw me back to those C64 times. Then again, the comment made not sense at all, however there were a ton of those in the listing, so I guess there was some mandated comment quote and the dev got bored and just wrote nonsense.

  • (nodebb)

    Years ago on a hobby project, I ran into something like "You don't want to know" and had to figure it out anyway. (It was a Forth variant, turns out the function just expected eight items on the stack in the right order. Far from the worst code I've ever personally run into.)

  • (nodebb)

    I'll just remind the regulars here of the one I found once:

        /* This doesn't work and I don't know why not */
    

    And, of course, it took me about ten minutes to work out why not, just by following the code around.

  • ricecake (unregistered)

    I like this one (from https://stackoverflow.com/questions/184618/what-is-the-best-comment-in-source-code-you-have-ever-encountered/482129#482129):

    // 
    // Dear maintainer:
    // 
    // Once you are done trying to 'optimize' this routine,
    // and have realized what a terrible mistake that was,
    // please increment the following counter as a warning
    // to the next guy:
    // 
    // total_hours_wasted_here = 42
    // 
    
  • (nodebb)

    Sometimes I leave comments along the lines of "I probably screwed up type conversion, but it works".

  • (nodebb)

    Not to mention all the ones along the lines of 'temporary hack. remove ASAP'.

  • (nodebb) in reply to thosrtanner

    In .net ´´´// HACK´´´ is actually something that shows up in the TODO list of Visual Studio - with obviously ´´´// TODO´´´. So at least there's some tooling support for those exact keywords for the last two decades.

  • NULL (unregistered)
    Comment held for moderation.
  • King (unregistered)

    I saw this in assembler code from the 80's, right after a tricky part: "Neat, eh!"

  • Argle (unregistered)
    Comment held for moderation.
  • (nodebb)
    Comment held for moderation.
  • (nodebb)

    That third one could well be mine, I've certainly left a similar one before. In my defense, the company was so toxic that there wasn't the opportunity to do things right. My recommendation to Samir is to get out ASAP.

  • (nodebb)

    That third one could well be mine, I've certainly left a similar one before. In my defense, the company was so toxic that there wasn't the opportunity to do things right. My recommendation to Samir is to get out ASAP.

  • löchlein deluxe (unregistered)

    I love how code formatting gone wild in the second example makes it sound like the gym teacher from Beavis and Butthead. (Or Dave Spokesperson, for people under 40?)

  • (nodebb) in reply to MaxiTB

    Probably ported from something that was written in 6502

  • Lubricant (unregistered) in reply to MaxiTB
    Comment held for moderation.
  • Neveranull (unregistered)
    Comment held for moderation.
  • Robert Markus (unregistered)
    Comment held for moderation.

Leave a comment on “Minimal Commentary”

Log In or post as a guest

Replying to comment #:

« Return to Article