• Shambo (unregistered)

    Can't you get in trouble for posting diebold source code?

  • (cs)

    public void First() { //Yeeeay! } refactored to

    public void AlmostFirstIfOnlyIWasAFewSecondsEarlierThenItWouldntBeSoLong_MaybeNextTime() { //Booo }

  • Todd (unregistered)

    I thought it was funny.

  • xix (unregistered)

    How to do self-documenting code right: Write your comment for the method, remove the spaces, and then make it the method name. WorksEveryTime()

  • (cs)

    ThisIsAVeryLongCommentThatIsAllOneCallFromThatCode(orWouldBeExceptICan,tBeBotheredToWriteThatMuch);

  • (cs)

    At least when this eventually crashes, the stack trace will be unusually descriptive.

  • (cs) in reply to Shambo
    Shambo:
    Can't you get in trouble for posting diebold source code?
    Only if he posts

    private void RigTheResultsSoThatTheBushiesWinAgain() { }

    code.

  • Anonymous Cow-herd (unregistered)

    Use of the m_ prefix combined with German-style agglutination - is this Austro-Hungarian Notation?

  • matt (unregistered)

    Buy yourself a fedora.

  • (cs)

    WhoNeedsCommentsAnyway?

  • (cs)

    ThisIsTheBeginningOfTheFunctionNameWhichYouHaveJustFinishedReading();

  • (cs)

    max identifier/function name length increased in compilers + auto-completion + camel case = headache

    ok, this comment is not LongMethodName(TM) compliant...

  • Dave (unregistered)

    I love that they abbreviated check in the first occurance:

    chkApplyUpdateToMainAndFutureRecords.Checked

  • Trawn (unregistered)

    This must be a Diebold/Seqouia coder. Check for

    if (CandidateIsARepublicanAndWeNeedToWin()){

    AddRandomExtraVoteToRepublican(); SendExtraPennyToRandomOffshoreCodingFirm(); }

  • (cs) in reply to Lexarius
    Lexarius:
    At least when this eventually crashes, the stack trace will be unusually descriptive.
    Not to mention several megabytes long. Hope they're not having their stack traces automatically e-mailed.
  • lolzJ (unregistered)

    Hey, look on the bright side, at least you don't have to read comments to figure out what it's doing! Oh wait.. 0_o

  • (cs)

    At least they're descriptive... when unsure use a method/class name generator: http://www.classnamer.com/

  • (cs)

    I call shenanigans! Given the amount of bad code this guy presumably has to encounter every day, long method names CAN'T be the thing that annoys him the most.

  • Chucara (unregistered)

    This is why I insist on a "Maximum 3 letters for function names" code standard.

  • WC (unregistered) in reply to Dave
    Dave:
    I love that they abbreviated check in the first occurance:

    chkApplyUpdateToMainAndFutureRecords.Checked

    I love that you have no idea why.

  • (cs) in reply to Chucara
    Chucara:
    This is why I insist on a "Maximum 3 letters for function names" code standard.
    Three letters should be enough for anybody. After all, that's all you need for "YES", "NO" and "FNF".
  • Rob (unregistered)

    Better too long than too short, as the ladies say (not mine, unfortunately).

  • Symbiatch (unregistered)

    Fortunately Visual Studio has refactoring so you can change those to something "a bit" better. But still, takes a lot of time...

  • Shinobu (unregistered)

    Use of uninitialized value in concatenation (.) or string interpolation at TalesFromTheLongMethodNameGenerator(int maxLength) line 1.

  • Jim (unregistered)

    This is code from a Diebold voting machine, right?

  • Jeff (unregistered)

    Ah, the prose (but not pros) way to code.

  • NeoMojo (unregistered) in reply to Chucara
    Chucara:
    This is why I insist on a "Maximum 3 letters for function names" code standard.
    It's been the standard since 1983 for a reason!
    WC:
    Dave:
    I love that they abbreviated check in the first occurance:

    chkApplyUpdateToMainAndFutureRecords.Checked

    I love that you have no idea why.

    So much love!

    I should probably mention Diebold, just to be with the in crowd. Also, I like sounding political.

  • NevroMance (unregistered)

    Cool. A nice way of not having to comment the code.

  • (cs)

    I worked with one of these guys.

  • rk (unregistered)

    I lol'ed

  • hibikir (unregistered)

    At work, we have the ThunderCougarFalconBird rule: If a class, variable or method name is as long as ThunderCougarFalconBird, it's way too long.

  • Dave (unregistered)

    while( LongVariableNamesCanBeHelpfulInUnderstandingCode && //YouCanDefinitelyGoTooFarTheOtherWayAndMakeAcronymsOutOfEachVariable
    ycdgtftowamaooev ) { ThisDoesNotMeanThatYouCanMakeUpFor( Design.Unintelligible | Design.AbsolutelyNone ); //ByMeansOfLongVariableNames }

  • FixedThat4ya (unregistered) in reply to jo42
    jo42:
    Shambo:
    Can't you get in trouble for posting diebold source code?
    Only if he posts

    private void RigTheResultsSoThatTheBushiesWinAgain() { }

    code.

    [/sarcasm]

  • (cs)

    Well, I don't know about anybody else, but I went blind before I could read to the end of the first method name.

    Don't they have goggles for this sort of thing?

    I'm intrigued by the parameter name, however. "electionDate?" It's not very descriptive under the circumstances, is it?

    Did the guy get RSI, or is it just that every single election occurs on the same date?

  • (cs) in reply to xix
    xix:
    How to do self-documenting code right: Write your comment for the method, remove the spaces, and then make it the method name. WorksEveryTime()
    What, OhFuckIveLostTheWillToLiveAndJustPostedOnYouTubeAndNowImGoingToClimbATowerAnd SprayRandomPassersByWithAHighPoweredAutomaticWeapon?

    What use would that be?

  • no one of significance (unregistered)

    I wouldn't be able to start my day as a developer without my trusty fedora.

    Then there's the guy I used to work with who'd write code with The Raiders March blaring in the background.

  • (cs)

    Okay, the real WTF(R) is migrating from VB .NET to C#. What's the point?

  • (cs)

    private void shouldntYouBeUsingLowerCaseInTheBeginningOfTheMethodName(String yes) { }

    Now I know why no-one trusts Diebold voting machines... ;)

  • SomeCoder (unregistered) in reply to hibikir
    hibikir:
    At work, we have the ThunderCougarFalconBird rule: If a class, variable or method name is as long as ThunderCougarFalconBird, it's way too long.

    One word.... ThunderCougarFalconBird.

    Futurama FTW.

  • Vincent Curry (unregistered)

    What a lovely thought. This code is used in election systems. No wonder people don't have faith in them...

  • Yohance (unregistered)

    how about this one

    public theBestThingAboutThisMethodNameIsThatByTheTimeYouFinishReadingItYouRealizeThatItSaysNothing (int variable){ }

  • Sander Hoogendoorn (unregistered)

    I've read carefully throughout all the comments on this peculiar post. Didn't anybody notice that the developers of this beautifully titled method aren't even aware of the abundant use of boolean logic in this code? Maybe it's because I'm a bit authistic, but if people write code like this:

    if (electionDate < DateTime.Today)
        {
            chkApplyUpdateToMainAndFutureRecords.Checked = false;
        }
        else
        {
            chkApplyUpdateToMainAndFutureRecords.Checked = true;
        }
    

    I just have to refactor it. Just can't leave this poor method like this. I would suggest the following line of code.

    chkApplyUpdateToMainAndFutureRecords.Checked = (electionDate < DateTime.Today);
    
  • Harrow (unregistered)

    I think removing the spaces from a descriptive comment to generate a method name is a wussy weinie way to go. REAL programmers name a method by extracting the alphanumeric characters from the CODE:

    function begin_JJ_ColorToRGB_aiWinColor_KK_not_JJ_LL_JJ_for_II_1_to_7_do_begin_LL_LL_shr_1_or_808080_KK_KK_and_LL_end_result_JJ_or_KK_end( aiWinColor : longint ) : longint;
    var II, JJ, KK, LL : longint;
    begin 
       JJ := ColorToRGB(aiWinColor);
       KK := not JJ;
       LL := JJ;
       for II := 1 to 7 do begin 
          LL := (LL shr 1) or $808080;
          KK := KK and LL;
       end;
       result := JJ or KK;
    end;

    -Harrow.

  • duffolonious (unregistered)

    Don't tell me... this is code from a Diebold voting machine isn't it?

    See if it has the "GeorgeWalkerBushGuaranteedVictoryForThe2004ElectionsByWayOfVoteRedistributionAndDiscounting ofPeopleWithUnAmericanNames" method.

    Be sure of the result as well:

    { ... //return McCain; //return Obama; return Darth_Vader; }

  • (cs) in reply to no one of significance
    no one of significance:
    I wouldn't be able to start my day as a developer without my trusty fedora.

    Then there's the guy I used to work with who'd write code with The Raiders March blaring in the background.

    What you actually need is the intro from Hans Pfitzner's "Palestrina."

    Trust me. It's quite relaxing.

    You can lie on the couch and tell me about it later. My rates are reasonable.

  • (cs) in reply to duffolonious
    duffolonious:
    Don't tell me... this is code from a Diebold voting machine isn't it?

    See if it has the "GeorgeWalkerBushGuaranteedVictoryForThe2004ElectionsByWayOfVoteRedistributionAndDiscounting ofPeopleWithUnAmericanNames" method.

    Be sure of the result as well:

    { ... //return McCain; //return Obama; return Darth_Vader; }

    Are you seriously insulting Darth Vader by comparing him to George Bush?

    Or are you just suggesting that Diebold machines might have the occasional technical glitch?

  • Edward Royce (unregistered) in reply to Trawn
    Trawn:
    This must be a Diebold/Seqouia coder. Check for

    if (CandidateIsARepublicanAndWeNeedToWin()){

    AddRandomExtraVoteToRepublican(); SendExtraPennyToRandomOffshoreCodingFirm(); }

    Sooooo. Tell me. Who was it that went to prison for stuffing the ballot box in St. Louis? What party did they belong to?

    Democrat? Right in one.

    Sooooo. Who was it that won the governor race in Washington by 300 votes? Which county was it that found extra votes for the Democrats several times in the most unlikely of places? And the party of the election officials in that county?

    Democrat? Right in one.

    Stop being a dumbass. So far this place is fairly non-political. But if you want to turn this into a political fight then I'm more than pleased to start jacking your idiot ass right on up.

  • (cs)

    As in the english language, this is an error. It's called a run-on sentence. Variable names or functions should not be a whole sentence in themselves, they are only part of the whole sentence.

  • Edward Royce (unregistered) in reply to Chucara
    Chucara:
    This is why I insist on a "Maximum 3 letters for function names" code standard.

    I like letter + number combinations.

    Who can't tell what function A0921 does?

  • Edward Royce (unregistered) in reply to Rob
    Rob:
    Better too long than too short, as the ladies say (not mine, unfortunately).

    Unfortunately?

    So your lady says "better too short than too long"??

Leave a comment on “TalesFromTheLongMethodNameGenerator(int maxLength)”

Log In or post as a guest

Replying to comment #196918:

« Return to Article