Event-driven software


An event is something that happens, like a button being clicked, or a page opening.

Event-driven programming is where you attach code to events. That breaks your code into pieces. Some code for a button click, different code for a different button click, yet more code for when a page loads, and so on.

Usually, variables coordinate the code fragments. Maybe button 1 changes a variable, and button 2 uses the variable's new value.