• h0 (unregistered)

    I don't see anything wrong with this. Generic event handlers such as this aren't specific, hence it being generic.

  • tim (unregistered)

    It's not really generic though. It's just specific in its case statements. So instead of abstracting your functionality, you've supressed it a level and missed it together. So if you want to try and find the functionality of "event a" you have to remember there's no function "EventAOnFire" there's a "EverythingIsFired" and it's in there somewhere. This buys you nothing (unless headaches and confusion are something you want). Of course that's just my opinion.

  • tim (unregistered)

    missed=mixed

  • AIM48 (unregistered)

    Reminds me of the service method of a good old Java servlet (or ASP page for that matter) -

  • Ilya Haykinson (unregistered)

    This great sample of coding wisdom also showcases another gem: the use of the Saving Disk Space pattern. Observe how the author masterfully named the method "Srch..", no "Search..". The immense savings of disk space and final size of the executable more than make up for any potential inconvenience this could possibly bring to someone else reading the code.

  • Centaur (unregistered)

    I HadThisPattern once. Instead of having lots of small batch files to do different unrelated tasks, I would stick them all as sections in one large file which had at its heading a checked “goto %1”. I also used a 4DOS feature to map all unknown commands to this all-in-one batch.

    Seriously, of course it is a maintenance nightmare, and I got rid of it once I moved to a better file system.

  • Andy Brummer (unregistered)

    Given the title, I thought I'd see code litered with

    throw new Party("ErrorMessage");

  • Phil Scott (unregistered)

    That "Saving Disk Space pattern" is hilarious. Thank Ilya, I'll have to remember that one.

  • Ray S (unregistered)

    One event handler to run them all, and in the darkness bind them.

  • El Fuge (unregistered)

    When I was in college, that's how I saw everybody do it, and it's how they kept on catching exceptions even after being pointed out how and why it was wrong.

    Some people never learn.

  • DrFooMod2 (unregistered)

    First, I'm a C# coder, but there is one "usefull" fearure in VB.NET (caugh) that's not in C#, and that's exception filters. So, this is a workaround in C#.

Leave a comment on “When developers "Throw" Parties”

Log In or post as a guest

Replying to comment #:

« Return to Article