- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Meh. As long as it does what it says on the tin, length of name is the least of our problems.
Admin
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.
Admin
Slow WTF day eh Remy?
Admin
proofs please, I can not find link to it
Admin
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.
Admin
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.
Admin
As method signatures go, that's John Hancock.
Admin
Wow, and I thought some of the class names in Roslyn were huge. My personal favorite would probably be
BoundTreeRewriterWithStackGuardWithoutRecursionOnTheLeftOfBinaryOperator
.Admin
Clearly what we need is the #define equivalent of bit.ly amirite?
Admin
We all deserve to burn there. I seriously doubt that anyone here has never written bad code.
Admin
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...
Admin
The spring link:
404 Not Found: Requested route ('spring.io') does not exist.
Admin
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
Admin
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?
Admin
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.
Admin
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.
Admin
@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.
Admin
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...)
Admin
Many years ago, I won a prize at a company-internal ObjC/Cocoa training course by finding that one...
Admin
I just came across this whilst working on a GDS:
EnhancedAirBookRSTravelItineraryReadRSTravelItineraryItineraryInfoItineraryPricingPriceQuotePricedItineraryAirItineraryPricingInfoPTC_FareBreakdownFlightSegmentBaggageAllowance