• St Mary's Flock of Storks (unregistered)

    Frist!

    And I call shenanigans on this.

  • Inhibeo (unregistered)

    The comment is converted at compile time to:

    throw new ShenanigansException();

    Where's the wtf?

  • Gumpy Guss (unregistered)

    You should be happy that they had the ability to correctly spell "shenanigans". See: Paula Bean and Brillant.

  • JoPoser (unregistered)

    Is ASP 95% of the programming market or just 500% of the fowled up code market?

  • Iain Collins (unregistered)

    Who are you people and how did you get access to my subversion repository...

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

  • (cs)

    on error resume next

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

    Interesting implementation of a long standing wtf pattern...

  • (cs)
    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.
  • 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.

  • (cs) in reply to Iain Collins
    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 !
  • Wolfraider (unregistered) in reply to ThePants999
    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

  • highphilosopher (unregistered) in reply to flex_lover
    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!!!!!!

  • Guybrush Threepwood (unregistered)

    I just finished a project in Flex, too. And I remember calling shenanigans more than twice.

  • racekarl (unregistered)

    Developers like Lucy aggravate me. Shipping is a feature! S/he is TRWTF

  • TK (unregistered) in reply to ThePants999
    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.
  • (cs)

    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.

  • OldHand (unregistered) in reply to TK
    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)

  • 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?

  • Crash Magnet (unregistered) in reply to lolwtf
    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

  • Shem Nanigans (unregistered) in reply to lolwtf
    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.

  • @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.

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

  • (cs)

    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.

  • Shenanigans (unregistered)

    You called?

  • (cs)

    Ah, a story oozing cynicism, bitterness and sarcasm. It feels as if I wrote it a long time ago and forgot about it...

  • VooDoo288 (unregistered) in reply to OutlawProgrammer

    You mean Shenanigans???

    Does that look like spit to you?

  • Will (unregistered) in reply to Jens Fiederer

    I was under the impression that "//FUCKO" was the industry standard?

  • NameNotFoundException (unregistered) in reply to racekarl
    racekarl:
    Developers like Lucy aggravate me. Shipping is a feature! S/he is TRWTF

    Ah! You must be that notorious duct tape guy.

  • (cs)

    Young children sometimes latch upon a word they think is funny and repeat it over and over, laughing to themselves.

  • Carl (unregistered) in reply to @Deprecated
    @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?
  • (cs) in reply to Jens Fiederer
    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".

  • (cs) in reply to Zylon
    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
    >
    
  • 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!

  • (cs)

    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?

  • Iain Collins (unregistered) in reply to Jens Fiederer
    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.

  • Everett (unregistered)
  • Schmalls (unregistered) in reply to OutlawProgrammer
    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.
  • 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...

  • Anon (unregistered)
  • Sellars (unregistered) in reply to Wolfraider
    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)

  • @Deprecated (unregistered) in reply to Carl
    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.

  • (cs) in reply to ThePants999
    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."

  • Don (unregistered)

    I can't believe nobody pointed out the real WTF: a senior developer named Lucy?!? I call shenanigans!

  • Captain O'Hagen (unregistered) in reply to Everett
    Everett:

    pistol-whips Everett for saying shenanigans

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

  • SarahE (unregistered) in reply to Sellars
    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

  • (cs) in reply to JoPoser
    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..

  • foog (unregistered) in reply to Anonymous

    I learned how unimportant robust error handling was when a "senior developer" corrected code like that by simply removing the unhandled paths of execution!

  • John (unregistered) in reply to WhiskeyJack
    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?

  • Zapp Brannigan (unregistered) in reply to hikari
    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?

Leave a comment on “The Shenanigans Handler”

Log In or post as a guest

Replying to comment #:

« Return to Article