- 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
Frist!
And I call shenanigans on this.
Admin
The comment is converted at compile time to:
throw new ShenanigansException();
Where's the wtf?
Admin
You should be happy that they had the ability to correctly spell "shenanigans". See: Paula Bean and Brillant.
Admin
Is ASP 95% of the programming market or just 500% of the fowled up code market?
Admin
Who are you people and how did you get access to my subversion repository...
Admin
I like this but I think they could improve it by writing to the event log so they can trace exactly when the shenanigans occurred.
Admin
on error resume next
try { ... } catch { (empty block to do nothing) }
Interesting implementation of a long standing wtf pattern...
Admin
Admin
Your fellow developer probably figured that even if he takes care of all possible errors in a very robust way, his code would still run in an Adobe VM, so why bother?
I can't blame him.
Admin
Admin
It's because he is related to a boy named Sue
Admin
HA the mudslinging begins!!!!!
Down with Cold Fusion!!!!!!
Admin
I just finished a project in Flex, too. And I remember calling shenanigans more than twice.
Admin
Developers like Lucy aggravate me. Shipping is a feature! S/he is TRWTF
Admin
Admin
Reminds me a bit of some of my first VB6 code ever:
if Foo = True then '... else if Foo = false then '... else MsgBox "Something's gone horribly wrong!" exit end if
And I call shenanigans on having to submit this post 3 times.
Admin
Or a grammar nazi?
(Really annoying that I can't cut&paste the CAPTCHA, I have to type the damn thing)
Admin
Hey Farva what's the name of that error handling pattern you like with all the goofy shit on the walls and the mozzarella sticks?
Admin
Of course, FILE_NOT_FOUND
Admin
Well, you know, your previous attemps got stuck in the shenanigans handler in TDWTF webserver. No hard feelings.
Admin
Wow, now that is some quality TDWTF.
I was unprepared for that, and let's just say I needed to grab a kleenex quick.
Admin
I suspect "// shenanigans" is a DEVELOPMENT-time error handler.
I have something similar - "// crq" so I can do a quick grep and find where my code is not yet complete.
So the real WTF would not be so much the programmer as the one who let non-production-ready code into the production environment (of course, these could easily be the same person).
Admin
You don't even need to read that code to tell it's going to be hideous-- Just looking at the brace style is evidence enough.
Admin
You called?
Admin
Ah, a story oozing cynicism, bitterness and sarcasm. It feels as if I wrote it a long time ago and forgot about it...
Admin
You mean Shenanigans???
Does that look like spit to you?
Admin
I was under the impression that "//FUCKO" was the industry standard?
Admin
Ah! You must be that notorious duct tape guy.
Admin
Young children sometimes latch upon a word they think is funny and repeat it over and over, laughing to themselves.
Admin
Admin
That seems quite possible, and it does help mitigate the WTF factor, but there are still two issues beyond the WTF you mentioned about it leaking to production:
They could at least have it emit some sort of message in the interim so that the developers are aware that the unwritten error handling code would have kicked in.
In the example given, the accountType being neither "private" nor "shared" seems like the sort of thing that might be caused be a development error elsewhere. Otherwise some other developer may wind up going crazy because his commits are silently failing due to a typoed accountType of "pricate".
Admin
Admin
Basically looks like the developer targeted the 95% majority of the cases. The rest, do it later.
I'm not a fan of hugely informative error messages sent to the user. Most of the time the user can't do anything about it - no connections available, disk full, service not ready, etc. Too often, I see error messages returned to the user as the "resolution" to the problem.
My preference is just return a boolean true/false to indicate success and design the code accordingly. As opposed to debug messages - more info is better!
Admin
Why does everyone have to invent their own brand of C++? This is so like Java and C#, but just not completely. Why, oh why?
Admin
Specific implementation aside I think incomplete error handling is extremely common and entirely forgivable in some environments (i.e. depending on the type of software your writing, the environment it will be used in, how self contained it is, what the commercial pressures are, etc).
However, it's best to to stick to commonly used tags like FIXME, TODO, DELETEME that are widely used and understood (and which some editors/IDE's/bug tracking systems use to automatically generate lists of tasks).
The use of custom tags as needed is fine, but making it clear they are tags by the formatting, and documenting them (ideally along with the source in a plain text file) is the way to go.
Admin
Admin
Admin
Awesome. In honor of this post, all new functions I write today will return "shenanigans"; instead of their normal error codes. Course I'll have to go fix em all tomorrow...
Admin
Admin
Either that or a man named Jayne.
(/me notices the Whedonites lurking)
Admin
Ummmm... I don't know what you use your kleenex for, but I am guessing it would not be used for the next Kimberly-Clark advertising promotion.
Actually, looking at their site, maybe they will!
http://www.kleenex.com/NA/Default.aspx Slogan: "Kleenex(r) Tissues: It Feels Good to Feel" Featuring the "stop and feel corner"
Great, now I'm gonna get fired or something.
Admin
"odd man out" is an idiom, you don't have to change the gender just because the subject isn't male.
It should also be noted than one of the definitions of "man" is "A human regardless of sex or age; a person."
Admin
I can't believe nobody pointed out the real WTF: a senior developer named Lucy?!? I call shenanigans!
Admin
pistol-whips Everett for saying shenanigans
Admin
I can't say I'm that excited about today's submission. All we have here is a method with three unhandled paths of execution and it's pretty clear that the unhandled paths are outside the normal flow of execution anyway (not that it's any excuse). I see this crap every day and I bet most other readers here do too. As far as I can see, this was only featured because of the "shenanigans" comment. Wow, a funny(?) comment.
Admin
"Jayne is a girl's name" "Well Jayne ain't a girl. She starts on that 'girl's name' thing, I'm a show her good an' all I got man parts."
...
Applicable, considering the other discussion about tissue :D
Admin
Its nowhere near 500% in anything derived from the chicken industry..
Admin
I learned how unimportant robust error handling was when a "senior developer" corrected code like that by simply removing the unhandled paths of execution!
Admin
I still do that.
PS Is this "Lucy" hawt?
Admin