Topic 10 · Notes

Principles of programming

These notes are part of the Study subscription

11 sections covering the whole specification for this topic, with worked examples.

Preview

Programming paradigms

A paradigm is a style or approach to programming: a way of thinking about how a program is organised.

ParadigmMain ideaExamples
ProceduralA sequence of instructions, broken into procedures and functionsPython, C, Pascal
Event-drivenCode runs in response to events such as clicks and key pressesVisual Basic, JavaScript in web pages
VisualPrograms built by arranging graphical blocks or diagramsScratch, App Inventor
Object-orientedPrograms made of objects that hold data and the methods that act on itJava, 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.)

Also in these notes

  • Procedural programmingAS
  • Event-driven programmingAS
  • Visual programmingAS
  • Objects, classes and methodsAS
  • High-level and low-level languagesAS
  • Choosing a paradigmA2
  • Object-oriented principlesA2
  • Class relationships and class diagramsA2
  • Language standardisationA2
  • Syntax diagrams and BNFA2