- 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
FristOfManyCommentsOrItWillBeIfICanFinishWritingItBeforeSomeoneElseGetsThereBeforeMeAlthoughIKnowThisIsProbablyAFairlyForlornHope
And Akismet thinks it's spam. What is he on?
Admin
Crack, mostly.
Admin
Double FRIST
Or maybe not.
Admin
It's self-documenting code. D'uh.
Admin
Wow, almost frist never seen so little comments on a WTF - must have clicked on at the instant it was posted.
By the time I've finished writing this, I predict there will be at least 5 other comments...
Admin
Ah! This reminds me of some code I found from some guy who really loved Grails dynamic finders, but this guy took the concept to another level:
findAllByDateTimeReceivedBetweenAndAmountLeftJoinByIdsGroupByAmountBookUserTitle(java.sql.Date date)
Not exactly the name of the method, but you get the idea.
Admin
I've thought of a way to improve it:
public bool SSPCSPPAUPPAUPMTBDNMAPTHNDPA { get; set; }
... cut the name down to its initials. A dramatic improvement, though I say it myself.
Admin
Optimized.
Admin
The first one seems to be a sarcastic response to something a PHB might have said.
Admin
Admin
Clay continues, "someone should write a plug-in that limits method names to a sane amount of characters."
He submitted it using the Daily WTF add-in. That limits bad practice for most of us....
Admin
I'm not sure how this is going to "corrupt data".
int length = data.GetRange(0, 3).ToArray().Length;
The summary (seems to) state that data will be a 3-character string. I thought maybe it was failing on 0/1/2-character strings, but GetRange would throw an exception, rather than "corrupting data".
Either the summary is confusing, or I'm missing something fundamental. 50/50 odds, I'd say.
Admin
Imagine the auto-complete fun if there were several similarly named functions:
SettingStorePriceChangesStoreProductPriceAndUpdatesProductPriceAndUpdatesProductModifiedTimestampButDoesNotModifyAProductThatHasNonDefaultPricingAlready1 SettingStorePriceChangesStoreProductPriceAndUpdatesProductPriceAndUpdatesProductModifiedTimestampButDoesNotModifyAProductThatHasNonDefaultPricingAlready2 SettingStorePriceChangesStoreProductPriceAndUpdatesProductPriceAndUpdatesProductModifiedTimestampButDoesNotModifyAProductThatHasNonDefaultPricingAlready3
Admin
When Martin Fowler wrote "Code As Documention", I think that wasn't what he had in mind.
Admin
I'm usually pro Camel/Pascal casing. However, this WTF shows readability does seem to break down with very long variable names. Maybe I'll join the underscore camp now.
Admin
When you see stuff like that in one of those applications, you know somewhere up in the call stack there's something like
that you will totally break if you correct the aforementioned line.
Admin
For the first thing, StyleCop will give you a warning for such beautiful and descriptive names. StyleCop will also warn you if you forgot providing /// comments for public properties, methods, ...
But such smart developers will disable that warnings ^^
Admin
Having 'and' in a method/test name is a smell indicating the method is doing more than it should. In this case, however... :?
captcha: consequat - the results of eating an overripe kumquat
Admin
Admin
...AndMakesYouCoffeeAndFixesTheKitchenSinkToo()
and this and that and another thing, and it adds up to nothing in particular.
Admin
I prefer fluent stuff, because you can use returns! So much more readable like this:
Admin
Admin
The first one is actually from obfuscated code. The developer used a product called ItWorksBecauseItTurnsAllPropertyNamesIntoLongWindedNonsenseAndMostDevelopersHaveADHDAndWillLoseInterestFuscator.
Admin
Apropos of the WTF on female programmers, I'm going to guess the gender of each programmer.
The first one was written by a female who likes long members.
The second was written by a male who thinks length doesn't matter.
Admin
Consider the alternative:
SettingStorePriceChangesStoreProductPriceAndUpdatesProductPriceButDoesNotUpdateProductModifiedTimestampOrModifyAProductThatHasNonDefaultPricingAlready SettingStorePriceChangesStoreProductPriceButDoesNotUpdateProductPriceOrUpdateProductModifiedTimestampOrModifyAProductThatHasNonDefaultPricingAlready SettingStorePriceChangesStoreProductPriceButDoesNotUpdateProductPriceButDoesUpdateProductModifiedTimestampButDoesNotModifyAProductThatHasNonDefaultPricingAlready SettingStorePriceChangesStoreProductPriceAndUpdatesProductPriceAndHolyShitsnacksIHopeNobodyHasToMaintainThisSinceItsHardToSeeDifferencesInTheseNamesWhenTheyreNotLinedUpAboveEachOther
Admin
I think it's improved even more if you don't mix the two systems. That is, do use underscores, but don't capitalize every word.
Admin
Only if they don't also use StyleCop, which will by default complain about exactly the same thing. In fact it will complain about them being missing on private ones too.
Documenting things using the native documenting system is hardly a terrible idea. Especially given Visual Studio will show those comments if you hover over a reference.
Admin
Send your resume to Peoplesoft, they hire people like you to design their data model.
Why use a long name when "PSAESTEPMSGDEFN" will do the trick?
Admin
Admin
That's so disgustingly sexist I'm going to reply angrily to every single post I see from now till the next WTF is posted. Come the revolution, every computer software engineer will be female and those nasty geeky nerdy boys will be banished to wherever those nasty asperger types belong.
Admin
This post is the first one I've read on this site which actually makes me feel quite ill. Well done, that man.
Admin
Variable name for all the ZX Spectrum users: "this name is so long that I shall never be able to type it out again without making a mistake"
;)
Admin
No, no, no. Clearly, the right approach is:
Admin
A female programmer would be more concerned with width.
Admin
Admin
Maybe IDEs should come with a tinyurl-like feature from now on.
Admin
I sentence the first offender to 1 year of coding with autocomplete disabled. bangs gavel
Admin
Testing? We don't need no stinking testing. The first rule is... if it compiles, move it to production.
Admin
Admin
Admin
Admin
"Maybe I'll join the underscore camp now."
Please do. camelCase is in my opinion useless for anything which is more than two small words stuck together.
Admin
Given the only GetRange I know of in .NET is this, then I'd tend to say we've been sadly mislead. Par for the course, I suppose.
I suspect that "data" is a list of strings, and if there's more than 3 of them then some were being ignored, which lead to much amusement later on in the form of missing messages or whatnot.
Admin
...or based on a PHB-mandated standard.
Admin
Admin
98% of my variable and Type names are two words stuck together, so I think I'm good right here.
Admin
Then again, I'm in the "Who cares? Neither camelCase nor underscores makes code hard to maintain; code like today's examples do" camp. It's a pretty good camp. The food is so-so.
Admin
Admin
I left COBOL because it gave me repetitive stress injury. No other language has accomplished that.
COBOL design motto:Why use 1 character when 10 will do?
Admin
Best_Comment_Of_The_Day