Could someone explain why Event driven programming have been developed in programming languages?
Event-driven programming is best-suited for programs that does not have control over when input may come, such as in a typical GUI program. A user can click on any button at any time. Traditional (non-event based) limits input to certain expected time, and only process inputs given on that time-frame only. Many non-GUI events also happen outside the program’s control. Such as when a file finished writing, when a browser requested a file from the server (the server have no control on when client can request), etc. Traditionally, without event-based system, events that happens outside the predetermined time are either discarded or queued and the program will periodically check the queue. The queue method is the basis of event-driven programming; and an event-driven framework formalizes the process, so you don’t have to worry about managing the queue yourself.