Programming paradigms
A paradigm is a style or approach to programming: a way of thinking about how a program is organised.
| Paradigm | Main idea | Examples |
|---|---|---|
| Procedural | A sequence of instructions, broken into procedures and functions | Python, C, Pascal |
| Event-driven | Code runs in response to events such as clicks and key presses | Visual Basic, JavaScript in web pages |
| Visual | Programs built by arranging graphical blocks or diagrams | Scratch, App Inventor |
| Object-oriented | Programs made of objects that hold data and the methods that act on it | Java, C#, Python |
Many languages support more than one paradigm. Python can be written procedurally or with objects; a Visual Basic form is event-driven, but the code in each handler is procedural.
Procedural, event-driven and object-oriented are all imperative: the programmer writes the steps the computer must follow. (A2 also looks at declarative languages, where the programmer describes what is wanted rather than how to get it.)