Event driven vs sequential programming

sachin picture sachin · Dec 3, 2009 · Viewed 9.7k times · Source

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?

Answer

phoebus picture phoebus · Dec 3, 2009

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.