Event-driven programming refers to the programming technique where the flow of the program is driven by recognition and handling of events such as mouse clicks, key presses, etc.

learn more… | top users | synonyms

44
votes
5answers
5k views

When should I use event-based programming?

I have been passing callbacks or just triggering the functions from other function in my programs to make things happen once tasks complete. When something finishes, I trigger the function directly: ...
10
votes
7answers
2k views

How to ease the maintenance of event driven code?

When using an event based component I often feel some pain at maintenance phase. Since the executed code is all split around it can be quite hard to figure what will be all the code part that will ...
5
votes
2answers
9k views

What is the difference between routed events and attached events?

I am just going through the WPF concepts I came across these routed events, dependency properties and attached events. What are the concepts behind them and why are they called instead of .NET ...
17
votes
4answers
838 views

What should plugins use: hooks, events or something else?

Consider an app that allows plugins to react to its program flow. I know 2 ways to achieve this: hooks and events 1. Hooks Use calls to empty functions inside the main program flow. These functions ...
12
votes
5answers
942 views

Is event chaining considered good practice?

From time to time I've encountered scenarios where several complex conditions need to be met prior to triggering an event. Furthermore, most listeners also run additional checks to determine the ...
11
votes
2answers
587 views

How does event bubbling generally work and is it synonym to event propagation?

I'm trying to wrap my head around the general workings and principles of event dispatching in event-driven (sub-)systems. Although I have used it on quite a few occasions in for instance Javascript, ...
0
votes
2answers
188 views

What's the simplest way to deal with events in C in this situation?

I'm writing a text-based game, in C. I want the game to handle NPCs movement and actions in the background, while the user is making his moves. I'd also use time-based events to tell the user when ...
5
votes
4answers
3k views

Learning event driven programming [closed]

I want to learn more about event driven programming. Especially where and why I would consider using events. What resources/books should I consider reading to this end? (note: I'm indifferent to ...
0
votes
3answers
389 views

When/Where to create/assign event handlers to its elements

Lets say I have the following code // JS $(function(){ $('[data-mc=logout]').click(function(){ if (!confirm(myconfig.msg['asklogout'])) { return false; ...