views:

315

answers:

2

One of my friend recently had an argument in his team about the pros and cons of event driven programming vs sequential programming.

What are your views about it?

+5  A: 

Two different methods to support two different needs. If you have a problem driven by events, then you should use an event-driven methodology. If you need to perform procedures on defined data, but you're not worried about what's happening elsewhere, then obviously you want to use a more "sequential" style.

Note that typically, these two things are combined. A program's startup, shutdown, and maybe a main processing loop (say, a filter processor in an image app) will be largely sequential, while its UI layer and component interactions are event-driven.

phoebus
A: 

As I understand it:

Event driven design good for software that has to react to users requests/demands. Typically most GUI and online based software is like this as far as I can tell. It has no or little in the way of a predefined order of operation since the user can choose to do anything (within the scope of the app).

Sequential is more often found in batch processing. The software that runs with little or no user input. The order of operation is largely preset.

There's not a strict divide since GUI based tools can obviously include relatively long running batch processes.

Tom Duckering