• Quite (unregistered)

    Meh. As long as it does what it says on the tin, length of name is the least of our problems.

  • Torsten (unregistered)

    Ah, the kids today... The longest method name (at least in any Apple platform) still remains the initializer for NSBitmapImageRep. https://developer.apple.com/reference/appkit/nsbitmapimagerep/1395538-initwithbitmapdataplanes?language=objc It's largely unknown today because there's no good reason to use it on OS X and it isn't on iOS at all, but it remains impressive.

  • Ron Fox (google)

    Slow WTF day eh Remy?

  • bvs23bkv33 (unregistered)

    proofs please, I can not find link to it

  • (nodebb)

    Observation: any function whose description includes multiple verbs linked with AND is suspect. If it includes multiple verbs linked with OR, it's more suspect because it implies control coupling.

    If the name reflects that suspect nature, as in the example, then whoever named it should burn in Hell.

  • Bobo (unregistered) in reply to Torsten

    That is not a long method name. The individual parts with in it are the way the Objective C language works. initWithBitmapDataPlanes is the method name, the rest is part of the signature.

  • Button Gwinnett (unregistered)

    As method signatures go, that's John Hancock.

  • Mason Wheeler (unregistered)

    Wow, and I thought some of the class names in Roslyn were huge. My personal favorite would probably be BoundTreeRewriterWithStackGuardWithoutRecursionOnTheLeftOfBinaryOperator.

  • Carl Witthoft (google)

    Clearly what we need is the #define equivalent of bit.ly amirite?

  • We all deserve that (unregistered) in reply to Steve_The_Cynic

    We all deserve to burn there. I seriously doubt that anyone here has never written bad code.

  • S. Ivar (unregistered)

    It reminds me of an error message on Apple systems which ended with: "and anyway the message is too long to fit into the message box" or something similar...

  • Ron Fox (google)

    The spring link:

    404 Not Found: Requested route ('spring.io') does not exist.

  • John (unregistered)

    Another advantage of working with Fortran. Fortran 2008 standard limits names to 63 characters. Also statements typically only exist between columns 7 and 72 making the source code appear like a newspaper column. I see no problem with statements like

            CALL BRGLIF(BrgGeomRollDiam(nBrgNum),BrgGeomPitchDiam(nBrgNum),BrgGeomRollNum(nBrgNum),
     *      BrgGeomThetaGUI(nBrgNum),BrgGeomRollLen(nBrgNum),BrgGeomIType(nBrgNum),Metric,rStandardCapacity(nBrgNum),
     *      rFc(nBrgNum),rSpecialCapacity(nBrgNum),RatioSpecialStandard)
    
  • löchlein deluxe (unregistered)

    This is where you exploit that in some languages, lots of high-plane Unicode are valid in identifiers, and dig out your APL keyboard setting. I'm sure we can fit a hungarian notation glyph for "no recursion on the left" there. (Bonus points for naming your exception variables U+1f4a9, and your handlers U+274a.)

    Btw, does anybody else measure how good their days are going to be by how quickly you guess where the unicorn is hiding?

  • Mr. Clean (unregistered)

    This is not a WTF, this is the logical result of "Clean Code" gone wild. And I quote from R.C.Martin's book, which contains just as many useful as misguided suggestions:

    "The name of a variable, function, or class, should answer all the big questions. It should tell you why it exists, what it does, and how it is used." ... "We want to be able to hear a class or function name and not be surprised when we discover its responsibilities." I.e.: The name should contain the entire documentation as one large string.

    "The length of a name should correspond to the size of its scope" ... "N5: Use Long Names for Long Scopes" I.e.: APIs must use huge names, corresponsing to the combined sizes of all potential applications which might use them.

  • Eugene (unregistered)

    The name itself is fairly good, BUT "and"-s are really clear indicator of the method is doing too much and should re-written using methods composition.

  • gnasher729 (unregistered)

    @Eugene: First, to rewrite the method, you need to get a job as a developer with Apple. Second, rewriting the method isn't going to change its name. Three, it very much sounds like an operation that I might want to be atomic, with no possibility that for example the first action succeeds and the others fail, so it should be one method.

  • (nodebb) in reply to We all deserve that

    True, and I include myself in that, but I do try to avoid that particular thing. (Yourdon and Constantine probably made an overly strong impression on me back in the day...)

  • (Kris) (unregistered) in reply to Torsten

    Many years ago, I won a prize at a company-internal ObjC/Cocoa training course by finding that one...

  • Valerian (unregistered)

    I just came across this whilst working on a GDS:

    EnhancedAirBookRSTravelItineraryReadRSTravelItineraryItineraryInfoItineraryPricingPriceQuotePricedItineraryAirItineraryPricingInfoPTC_FareBreakdownFlightSegmentBaggageAllowance

Leave a comment on “The Longest Method?”

Log In or post as a guest

Replying to comment #:

« Return to Article