Programming foundations

Stage 3 of 6 · 9 lessons · ~2 months

How computers run your code

Understand what happens below your code: bits, memory, the CPU, compilers and interpreters, and the operating system. Enough that bugs about memory and numbers stop surprising you.

Start: Binary, bits and bytes

Lessons· one lesson for each topic, in this order

  1. 1Binary, bits and bytes
  2. 2Text encodings: ASCII, Unicode and UTF-8
  3. 3Integers and overflow
  4. 4Floating point numbers
  5. 5How a CPU runs a program
  6. 6Compiled vs interpreted code
  7. 7Memory: the stack and the heap
  8. 8What happens when you pass a value to a function
  9. 9Processes and the operating system

Start with· follow one of these

Keep handy

  • Quick explanations of OS basics like processes and memory when a lecture skips a step

Also worth your time

  • Everything from a key press to a rendered page; read it after this stage

Before moving on: Explain in writing why 0.1 + 0.2 is not exactly 0.3, what happens in memory when you pass a list to a function in your language, and finish CS50x weeks 0 to 2 and week 4.

Tauseef's advice
You are not training to be a hardware engineer; you are learning enough that the machine stops feeling like magic. CS50x uses C on purpose and it will feel slow, so push through week 4, because memory is the idea everything later builds on.

Mark this stage as not done?