Comment On The Shenanigans Handler

"I'm a senior developer in a department developing, among other things, an Adobe Flex web GUI for the configuration of our products," writes Lucy. "Having worked on systems in the past which could require production fixes at 2:00 AM if something went wrong, I am a true believer in robust software (which allows you to sleep through the night). Fortunately, my current employment doesn't require that lovely on-call dedication, but it does leave me as the odd man out when trying to argue designing and implementing robust code versus time-to-ship with my team mates and manager." [expand full text]
« PrevPage 1 | Page 2 | Page 3Next »

Re: The Shenanigans Handler

2009-09-30 09:02 • by St Mary's Flock of Storks (unregistered)
Frist!

And I call shenanigans on this.

Re: The Shenanigans Handler

2009-09-30 09:03 • by Inhibeo (unregistered)
The comment is converted at compile time to:

throw new ShenanigansException();

Where's the wtf?

Re: The Shenanigans Handler

2009-09-30 09:07 • by Gumpy Guss (unregistered)
You should be happy that they had the ability to correctly spell "shenanigans". See: Paula Bean and Brillant.

Re: The Shenanigans Handler

2009-09-30 09:09 • by JoPoser (unregistered)
Is ASP 95% of the programming market or just 500% of the fowled up code market?

Re: The Shenanigans Handler

2009-09-30 09:09 • by Iain Collins (unregistered)
Who are you people and how did you get access to my subversion repository...

Re: The Shenanigans Handler

2009-09-30 09:12 • by Filo Pastry (unregistered)
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.

Re: The Shenanigans Handler

2009-09-30 09:17 • by snoofle
on error resume next

try {
...
} catch {
(empty block to do nothing)
}

Interesting implementation of a long standing wtf pattern...

Re: The Shenanigans Handler

2009-09-30 09:19 • by ThePants999
it does leave me as the odd man out

I think you're guaranteed to be the odd man out if your name is Lucy.

Re: The Shenanigans Handler

2009-09-30 09:24 • by flex_lover (unregistered)
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.

Re: The Shenanigans Handler

2009-09-30 09:26 • by SenTree
286526 in reply to 286521
Iain Collins:
Who are you people and how did you get access to my subversion repository...

Ah - NOW I understand why it's called subversion !

Re: The Shenanigans Handler

2009-09-30 09:27 • by Wolfraider (unregistered)
286527 in reply to 286524
ThePants999:
it does leave me as the odd man out

I think you're guaranteed to be the odd man out if your name is Lucy.


It's because he is related to a boy named Sue

Re: The Shenanigans Handler

2009-09-30 09:28 • by highphilosopher (unregistered)
286528 in reply to 286525
flex_lover:
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.


HA the mudslinging begins!!!!!

Down with Cold Fusion!!!!!!

Re: The Shenanigans Handler

2009-09-30 09:30 • by Guybrush Threepwood (unregistered)
I just finished a project in Flex, too. And I remember calling shenanigans more than twice.

Re: The Shenanigans Handler

2009-09-30 09:34 • by racekarl (unregistered)
Developers like Lucy aggravate me. Shipping is a feature! S/he is TRWTF

Re: The Shenanigans Handler

2009-09-30 09:35 • by TK (unregistered)
286531 in reply to 286524
ThePants999:
it does leave me as the odd man out

I think you're guaranteed to be the odd man out if your name is Lucy.

Except that, in this context, "man" can refer to a male or female.

Re: The Shenanigans Handler

2009-09-30 09:36 • by lolwtf
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.

Re: The Shenanigans Handler

2009-09-30 09:40 • by OldHand (unregistered)
286533 in reply to 286531
TK:
ThePants999:
it does leave me as the odd man out

I think you're guaranteed to be the odd man out if your name is Lucy.

Except that, in this context, "man" can refer to a male or female.


Or a grammar nazi?

(Really annoying that I can't cut&paste the CAPTCHA, I have to type the damn thing)

Re: The Shenanigans Handler

2009-09-30 09:40 • by OutlawProgrammer (unregistered)
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?

Re: The Shenanigans Handler

2009-09-30 09:40 • by Crash Magnet (unregistered)
286535 in reply to 286532
lolwtf:
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.


Of course, FILE_NOT_FOUND

Re: The Shenanigans Handler

2009-09-30 09:40 • by Shem Nanigans (unregistered)
286536 in reply to 286532
lolwtf:
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.


Well, you know, your previous attemps got stuck in the shenanigans handler in TDWTF webserver. No hard feelings.

Re: The Shenanigans Handler

2009-09-30 09:42 • by @Deprecated (unregistered)
Wow, now that is some quality TDWTF.

I was unprepared for that, and let's just say I needed to grab a kleenex quick.

Re: The Shenanigans Handler

2009-09-30 09:45 • by Jens Fiederer (unregistered)
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).

Re: The Shenanigans Handler

2009-09-30 09:47 • by Zylon
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.

Re: The Shenanigans Handler

2009-09-30 09:50 • by Shenanigans (unregistered)
You called?

Re: The Shenanigans Handler

2009-09-30 09:55 • by DOA
Ah, a story oozing cynicism, bitterness and sarcasm. It feels as if I wrote it a long time ago and forgot about it...

Re: The Shenanigans Handler

2009-09-30 10:00 • by VooDoo288 (unregistered)
286542 in reply to 286534
You mean Shenanigans???

Does that look like spit to you?

Re: The Shenanigans Handler

2009-09-30 10:06 • by Will (unregistered)
286543 in reply to 286538
I was under the impression that "//FUCKO" was the industry standard?

Re: The Shenanigans Handler

2009-09-30 10:07 • by NameNotFoundException (unregistered)
286544 in reply to 286530
racekarl:
Developers like Lucy aggravate me. Shipping is a feature! S/he is TRWTF


Ah! You must be that notorious duct tape guy.

Re: The Shenanigans Handler

2009-09-30 10:10 • by WhiskeyJack
Young children sometimes latch upon a word they think is funny and repeat it over and over, laughing to themselves.

Re: The Shenanigans Handler

2009-09-30 10:13 • by Carl (unregistered)
286546 in reply to 286537
@Deprecated:
let's just say I needed to grab a kleenex quick.

Because code like this is such a turn-on? Was it all those cuddly braces or do you just like saying Shenanigans Shenanigans Shenanigans?

Re: The Shenanigans Handler

2009-09-30 10:17 • by Erasmus Darwin
286547 in reply to 286538
Jens Fiederer:
I suspect "// shenanigans" is a DEVELOPMENT-time error handler.


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:

1) 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.

2) 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".

Re: The Shenanigans Handler

2009-09-30 10:19 • by snoofle
286548 in reply to 286539
Zylon:
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.

It could have been worse; imagine if languages like this used lisp-style enclosures...


override protected function commitChange():void
{ super.commitChange();
if ( this._dataChanged && this._data )
{ if ( this._data.type )
{ switch ( this._data.accountType)
{ case "private":
...
break;
case "shared":
...
break;
default:
//shenanigans
break;
>
else
{
//shenanigans
>
else
{
//shenanigans
>

Re: The Shenanigans Handler

2009-09-30 10:21 • by Buddy (unregistered)
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!

Re: The Shenanigans Handler

2009-09-30 10:25 • by TGV
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?

Re: The Shenanigans Handler

2009-09-30 10:34 • by Iain Collins (unregistered)
286552 in reply to 286538
Jens Fiederer:

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.


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.

Re: The Shenanigans Handler

2009-09-30 10:35 • by Everett (unregistered)

Re: The Shenanigans Handler

2009-09-30 10:37 • by Schmalls (unregistered)
286554 in reply to 286534
OutlawProgrammer:
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?

But our shenanigans are cheeky and fun.

Re: The Shenanigans Handler

2009-09-30 10:41 • by Shen (unregistered)
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...

Re: The Shenanigans Handler

2009-09-30 10:43 • by Anon (unregistered)

Re: The Shenanigans Handler

2009-09-30 10:43 • by Sellars (unregistered)
286557 in reply to 286527
Wolfraider:
ThePants999:
it does leave me as the odd man out

I think you're guaranteed to be the odd man out if your name is Lucy.


It's because he is related to a boy named Sue



Either that or a man named Jayne.

(/me notices the Whedonites lurking)

Re: The Shenanigans Handler

2009-09-30 10:52 • by @Deprecated (unregistered)
286558 in reply to 286546
Carl:
@Deprecated:
let's just say I needed to grab a kleenex quick.

Because code like this is such a turn-on? Was it all those cuddly braces or do you just like saying Shenanigans Shenanigans Shenanigans?


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.

Re: The Shenanigans Handler

2009-09-30 10:53 • by hikari
286559 in reply to 286524
ThePants999:
it does leave me as the odd man out

I think you're guaranteed to be the odd man out if your name is Lucy.


"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."

Re: The Shenanigans Handler

2009-09-30 10:56 • by Don (unregistered)
I can't believe nobody pointed out the real WTF: a senior developer named Lucy?!? I call shenanigans!

Re: The Shenanigans Handler

2009-09-30 10:56 • by Captain O'Hagen (unregistered)
286561 in reply to 286553
Everett:


*pistol-whips Everett for saying shenanigans*

Re: The Shenanigans Handler

2009-09-30 11:06 • by Anonymous (unregistered)
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.

Re: The Shenanigans Handler

2009-09-30 11:13 • by SarahE (unregistered)
286563 in reply to 286557
Sellars:
Wolfraider:
ThePants999:
it does leave me as the odd man out

I think you're guaranteed to be the odd man out if your name is Lucy.


It's because he is related to a boy named Sue



Either that or a man named Jayne.

(/me notices the Whedonites lurking)


"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

Re: The Shenanigans Handler

2009-09-30 11:15 • by pitchingchris
286564 in reply to 286520
JoPoser:
Is ASP 95% of the programming market or just 500% of the fowled up code market?


Its nowhere near 500% in anything derived from the chicken industry..

Re: The Shenanigans Handler

2009-09-30 11:16 • by foog (unregistered)
286565 in reply to 286562
I learned how unimportant robust error handling was when a "senior developer" corrected code like that by simply removing the unhandled paths of execution!

Re: The Shenanigans Handler

2009-09-30 11:29 • by John (unregistered)
286568 in reply to 286545
WhiskeyJack:
Young children sometimes latch upon a word they think is funny and repeat it over and over, laughing to themselves.


I still do that.

PS Is this "Lucy" hawt?

Re: The Shenanigans Handler

2009-09-30 11:32 • by Zapp Brannigan (unregistered)
286569 in reply to 286559
hikari:
ThePants999:
it does leave me as the odd man out

I think you're guaranteed to be the odd man out if your name is Lucy.


"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."
You never took Womyn's Studies in college did you?
« PrevPage 1 | Page 2 | Page 3Next »

Add Comment