Event-driven programming is a flexible weapon… like a whip. Design things right, and a flick of the wrist can roll down the length of your architecture and knock a cigarette out of a man’s mouth with a supersonic snap. Design wrong, and a half-hour later you’re in the emergency room with a wadded up T-shirt clamped to your forehead.
As a front-end developer, I’ve whipped myself in the forehead more times than I care to count. Do that often enough, and you start to get an intuition about things. I’ve got a theory about event handling: make your decisions at the right level of abstraction.
Maybe this is old hat. It should have been old hat to me, too, but you can’t see how old a hat is when you’re wearing it. But first let’s talk about kinds of events.