Grade 8 Computer Science
The year the program meets real data
A second year, in which the program stops living inside itself. We begin with the dictionary — reaching a value by name instead of searching for it — and go on to input from outside, which always arrives as text and never deserves trust without checking, and to files that survive the program closing. We break a program into several files and learn what a function promises whoever calls it, meet the first two algorithms for searching and sorting and ask why two correct ones are not equal, and get a way to measure the difference without touching a clock. We then deal with what happens before the code — understanding, decomposition and designing the data — and close with two subjects that take the program out into the world: how the internet really works, and what it means to hold information about people. The year ends with a final exam over the whole of it.
Input, output and files
- Input always arrives as text
- Checking input before trusting it
- A file — what remains after the program closes
- Reading a file line by line
- A structured format
- Common mistakes about input and files
- Summary practice — input and files
Modules and reuse
- When one file stops being enough
- Importing — how code reaches one file from another
- What is already written
- An interface — what a function promises
- Documentation that holds
- Common mistakes about modules
- Summary practice — modules
Searching and sorting
- Halving instead of going over
- Sorting by selection
- Sorting by insertion
- The sort the language already gives
- Checking that an algorithm is right
- Common mistakes about searching and sorting
- Summary practice — searching and sorting
Efficiency
- Counting operations, not measuring time
- Three shapes of growth
- Why the shape matters more than the constant
- Space against time
- When not to optimise
- Common mistakes about efficiency
- Summary practice — efficiency
How the internet works
- The network is agreements, not wires
- A name and an address
- Splitting into small messages
- A request and an answer
- When something does not work
- Common mistakes about networks
- Summary practice — networks
Security, privacy and responsibility
- What “secure” actually means
- Passwords and why they are weak
- Encryption — the idea without the mathematics
- Privacy — what is collected and why
- The responsibility of whoever writes
- Common mistakes about security and privacy
- Summary practice — security and privacy
Final exam — Grade 8 Computer Science
- Final exam — Grade 8 Computer Science