Exception handling - The Pokémon way



  • A friend of mine has made this illustration which shows how they do exception handling at his work. We like to call it "Exception handling - The Pokémon way":

    Exception handling - The Pokémon way

    I don't know if they actually sing the Pokémon theme while coding. Replace "Pokémon" with "Exception" and you're about there.

     

    Best regards

    Soeren 

     

     



  • heh, 

    I nominate this the most interesting title in the sidebar ever.

     



  •  Seconded - it scares me whenever I see this in live code (it's comforting to see ReSharper complain about it though, as that means it doesn't go entirely unnoticed).  (No, not code I've written)



  • Hmm, I've done this before.  In web apps, it's a good idea to do it at the top level and dump out an error page.  I've used the "Do nothing" variant, too.  It's usually because of exceptions being extensively overused in a piece of code I am integrating. 



  • Insert it into your code, so everyone can know what a pro coder you are...


    try {

     foobar();

    } catch (Exception e) {

    //0033@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    //@@00ff@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    //@@33ffff77@@@@@@@@@@@@@@@@@@@@@@33ff0000@@@@@@@@@@
    //@@@@33ffffff@@@@@@@@@@@@@@@@ffffffff00@@@@@@@@@@@@
    //@@@@@@@@ffffffffffffffffKKffffffff33@@@@@@@@ff@@@@
    //@@@@@@@@@@ffffffffffffffffaa00@@@@@@@@@@CCffff00@@
    //@@@@@@@@@@ffffffffffffffffffBB@@@@@@LLffffffffff@@
    //@@@@@@@@@@fQQfffffffffQQffffff@@@@ffffffffffffff00
    //@@@@@@@@00fQQfffffffffQQffffff@@@@ffffffffffWWYY00
    //@@@@@@@@QQffffffrfffffffQQ44ff@@@@00aaYYXX00@@@@@@
    //@@@@@@@@00ffffffffffffPPQQ00ff@@@@@@ffXX@@@@@@@@@@
    //@@@@@@@@@@ccffff~~ffffffffffff@@@@@@@@WW@@@@@@@@@@
    //@@@@@@@@@@ffPPffffffffffffffff33@@ffYYXX@@@@@@@@@@
    //@@@@@@@@@@ffffffffffffffffff00LL@@33TT@@@@@@@@@@@@
    //@@@@@@@@@@ffffffffffffffffffffff@@33DD@@@@@@@@@@@@
    //@@@@@@@@@@ffffffffffffffff00ffff@@88@@@@@@@@@@@@@@
    //@@@@@@@@@@00ffffffffffff00ffff6633DD@@@@@@@@@@@@@@
    //@@@@@@@@@@ffffffffffffffffffffffee@@@@@@@@@@@@@@@@
    //@@@@@@@@@@ffffffffffffffffffffff@@@@@@@@@@@@@@@@@@
    //@@@@@@@@@@YYZZYYXXXXZZffffffffSS@@@@@@@@@@@@@@@@@@
    //@@@@@@@@@@66YY0033@@33XXXXYY00@@@@@@@@@@@@@@@@@@@@
    //@@@@@@@@@@00@@@@@@@@@@@@00SS@@@@@@@@@@@@@@@@@@@@@@
    //
    //           GOTTA   CATCH   EM   ALL

    }



  • @Bumble Bee Tuna said:

    Insert it into your code, so everyone can know what a pro coder you are

    Sweet! Another ASCII graphic code comment. I've yet to use this one as a header because I'm scared our BA will see it one day:

        /*************************************************************
         *                                                           *
         *  .=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-.       *
         *   |                     ______                     |      *
         *   |                  .-"      "-.                  |      *
         *   |                 /            \                 |      *
         *   |     _          |              |          _     |      *
         *   |    ( \         |,  .-.  .-.  ,|         / )    |      *
         *   |     > "=._     | )(__/  \__)( |     _.=" <     |      *
         *   |    (_/"=._"=._ |/     /\     \| _.="_.="\_)    |      *
         *   |           "=._"(_     ^^     _)"_.="           |      *
         *   |               "=\__|IIIIII|__/="               |      *
         *   |              _.="| \IIIIII/ |"=._              |      *
         *   |    _     _.="_.="\          /"=._"=._     _    |      *
         *   |   ( \_.="_.="     `--------`     "=._"=._/ )   |      *
         *   |    > _.="                            "=._ <    |      *
         *   |   (_/                                    \_)   |      *
         *   |                                                |      *
         *   '-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-='      *
         *                                                           *
         *        ABANDON ALL HOPE, ALL YE WHO ENTER HERE            *
         *************************************************************/


  • @AbbydonKrafts said:

    I've yet to use this one as a header because I'm scared our BA will see it one day:

    My favorite "hope management doesn't see it" quote: 

    // To navigate through our categories, a form is submitted upon clicking a link, after which the submitted values are taken here and the client is 302'd
    // to the appropriate page. This is so very, very wrong. This code could not be more evil if it skull-fucked baby Jesus. I don't have time to fix it
    // so I'm letting it stand as a monument to human cruelty, like the Holocaust museum or something. It's fucking taking POST values to do a redirect
    // to a goddamn GET!!!!



  • @morbiuswilters said:

    My favorite "hope management doesn't see it" quote:

    O_O Whoa! LOL



  • I wonder what the global exception handler throws at you? 

    Must be somesort of eletric shocks and a custom audio sample shouting "PICACHUUU".

    But then i would think my Windows puter has a new audible virus. 



  • I'd think this sort of exception handling would be prone to the occasional MISSINGNO.

    (Yes, I desperately need a life.)



  • @codeman38 said:

    I'd think this sort of exception handling would be prone to the occasional MISSINGNO.

    (Yes, I desperately need a life.)

    [url="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Throwable.html"]It[/url] [url="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Error.html"]is[/url]. 


Log in to reply

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.