Skip to content

Programming from First Principles Notes

This folder contains a Python-based study guide for the subject Programming from First Principles across Modules 1 to 14. It is written as exam-ready revision notes with one page per module plus supporting revision resources.

Each module follows three learning layers:

  1. Simple idea: plain language and a familiar analogy.
  2. Worked example: small Python code traced step by step.
  3. Technical meaning: correct definitions, notation, types, and exam points.

Finish the memory rules and self-check before reading the answers.

Module-wise study method

  1. Review the prerequisites and complete one study block at a time.
  2. Type each Python example into the interpreter or notebook and predict the result before running it.
  3. Read errors as feedback about syntax, types, or missing definitions.
  4. Complete the mini quiz and practice ladder before revealing solutions.
  5. Mark the module Mastered after writing and tracing a fresh example unaided.

Module Index

ModuleTopicFile
1Data types and collectionsModule 1
2Higher-order functionsModule 2
3Standard constructsModule 3
4Iteration and lazy evaluationModule 4
5Anonymous functions and lambda calculusModule 5
6First-class functionsModule 6
7Type disciplineModule 7
8Type hints and inferenceModule 8
9User-defined typesModule 9
10Concrete typesModule 10
11RecursionModule 11
12Operational semanticsModule 12
13Protocols and shared behaviorModule 13
14PolymorphismModule 14

Support Material

How to Use This Folder

  1. Read the module note for the topic you are studying.
  2. Check the matching support pages for revision and memory aid.
  3. Use the web resources when you want a second explanation from an external source.
  4. Revisit the glossary before exams to fix terminology.

Suggested Study Order

  1. Module 1
  2. Module 2
  3. Module 3
  4. Module 4
  5. Module 5
  6. Module 6
  7. Module 7
  8. Module 8
  9. Module 9
  10. Module 10
  11. Module 11
  12. Module 12
  13. Module 13
  14. Module 14

Built from Markdown with VitePress.