answersLogoWhite

0

A program which is not written in an event-driven language runs line-by-line (typically starting from the `main' function/method), executing each command in sequence. It might interact with the user by asking for input, have `if' statements to adjust its computations, and display output in response.

Such programs often use libraries which supply boilerplate logic for this purpose, which is typically based on services provided by the operating system. An event-driven programming languagecomes with such a library. The idea is that sections of code are executed based on what the user does. Nothing will happen without an event causing it to do that action first. For example, you can listen for a mouse click and react to it with click-handling code, or likewise for key presses.

However, it is important to note that an event can be made from pretty much anything, and is by no means limited to local user input (such as a mouse click). Other events can be related to network activity, completion of time-consuming tasks started earlier, expiry of a duration of time, or even an arbitrary event condition.

The key difference between a "linear" programming approach, where the program spins in a loop continuously testing the various event conditions (and reacting when necessary) and an event-driven programming approach is that the latter uses services provided by the operating system. This allows not only for highly efficient event testing, but also allows the operating system to take care of other tasks while one program is waiting for a certain event to occur.

User Avatar

Wiki User

12y ago

Still curious? Ask our experts.

Chat with our AI personalities

RafaRafa
There's no fun in playing it safe. Why not try something a little unhinged?
Chat with Rafa
ViviVivi
Your ride-or-die bestie who's seen you through every high and low.
Chat with Vivi
BeauBeau
You're doing better than you think!
Chat with Beau

Add your answer:

Earn +20 pts
Q: What do you mean by event driven programming language. explain with an example?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about TV & Celebs