//GTFO



  • So I'm refactoring some code.  We used to support "recommendations" on comments (i.e. "I like this comment").  Now we're making "scores" which can be thumbs up or down.

    So all those old existing recommendations need to be converted to scores the first time they're asked for.  Somebody noticed a bug where they're being converted multiple times.  So I go and look at the code I wrote.

            public void ConvertRecommendationsToScores(BaseKey parentKey){
                // Check if there are any scores defined.
                if (GetScoresForParent(parentKey).Count > 0) {
                    // Found some.  GTFO.
                }

                // No existing scores.  Fetch all the recommends from storage and start building.
                /* SNIP */

           }

     

    Evidently a comment that says "GTFO" is not quite the same thing as a return statement.



  • Amusing.

     

    Given the feature in question, I made sure to rate this thread.



  • @vt_mruhlin said:

    Evidently a comment that says "GTFO" is not quite the same thing as a return statement.

    Can't one write a macro for that? (Okay, that would be the real WTF, a compiler instruction turning a comment into code, but you never know...)

    Also, when I read this the first times, I thought you were talking about code comments. I thought your refactoring work is about turning code like:

      // Oh, the next line is cool. You better remember that!
      do_some_ninja_magic();

    Into something like:

      // Wow, I give this one a nine out of ten!
      do_some_ninja_magic();


  • Ah, the dreaded DoWhatIMean() bug strikes again.



  • @vt_mruhlin said:

    Evidently a comment that says "GTFO" is not quite the same thing as a return statement.
     

    Must have been hand translated from LOLCODE, whoever did it simply forgot to replace that line with a return statement.


Log in to reply