What's The Difference Between Event Driven Programming And Traditional Programming?


3 Answers

John Nawrocki Profile
John Nawrocki answered
In a traditional program the process typically repeats itself continuously, looking for information, processing information and outputting information. It fully event driven programming there is no process until an event occurs. Think of it in terms of your front door hall; all is quite in the hall until someone on the outside pushes a button (the event) then in the hall there is the sound of the door bell (the result of the event).
Florio Potter Profile
Florio Potter answered

In a Traditional Language, the flow of the program is mostly static and pre-defined by the programmer, changes in flow can be because of user inputs like, branch instructions or changes in the number of iteration in a loop control which may seem non-uniform but is too defined by the programmer on a set of pre-set conditions. There is a distinct start (main function call) and a distinct end (return from main function) and its synchronous - will wait until a user input is given to proceed further.

In an Event Driven Language (Kernel, JavaScript), there is no pre-set flow, no distinct start and end of a program. A programmer cannot know which function will be called at what time. Example - A page is loaded using XML Http Request, while other functions are working. The program won't wait for the page to load. It'll fire an "event", and the linked function will process it once the download is complete. A Mouse Handler Kernel Module, if waits for user input synchronously, will hang the computer if it keeps the control and stops other processes from happening. What happens is the Kernel fires an "event" and calls the linked function as and when required. This relieves the problems associated with "waiting for slower / user input".

For more information get help at CodeAvail-
Online Computer Science Assignment help

Answer Question