COMPUTERS · LEARN

Learn to Program

From what a program is to how big systems are designed: sixteen chapters, real 3D, code that runs in your browser, and an honest guide to how people actually get good at this.

  • Basics
  • Intermediate
  • Advanced
  • Architecture

16 CHAPTERS · 4 LEVELS

From your first line to systems at scale

Tap a tower, or fly the road with the arrows. Lit towers are open; wireframes are still being built.

Start: chapter 01 →
How to learn ↓

THE CHAPTERS

Basics to architecture

Basics

what a program is and how it runs

  1. 01What a program isFollow one tiny program from text to tokens, a tree, bytecode, the CPU and the screen.open
  2. 02Values, variables and memoryNumbers, text and true/false as bits in memory, and names that point at them.open
  3. 03Control flowMake decisions and repeat work: if, else, loops, and how the CPU jumps.open
  4. 04Functions and the call stackName a piece of work, call it, and watch frames pile up on the stack.open

Intermediate

organising data and code

  1. 05Data structuresArrays, maps, linked lists, trees and graphs: the shapes data takes, and what each is good at.open
  2. 06Algorithms and Big-OSort and search, and learn to say how the work grows as the input grows.open
  3. 07Objects, types and functional styleThree ways to organise code: objects with methods, type systems, and pure functions.open
  4. 08Errors, testing and debuggingRead an error, write a test that catches it, and find the bug on purpose.open

Advanced

time, many things at once, data and networks

  1. 09Async and the event loopWait without freezing: callbacks, promises, async/await and the loop that runs them.open
  2. 10Concurrency and parallelismMany things at once: threads, cores, races, locks, and why it is hard.open
  3. 11Data and databasesStore data so it survives: tables, SQL, indexes and transactions.open
  4. 12Networks and APIsHow two programs talk: packets, HTTP, REST, JSON and the API contract.open

Architecture

building, securing and running real systems

  1. 13Software architectureShape a big program: layers, modules, monolith vs microservices, patterns and events.open
  2. 14System design at scaleServe millions: load balancers, caches, queues, replication and the CAP trade-off.open
  3. 15Security for programmersWrite code attackers can't bend: injection, authentication, secrets and least privilege.open
  4. 16Shipping itFrom your laptop to users: git, CI/CD, the cloud, and watching it run.open

HOW TO TRAIN AND LEARN

What the evidence says works

Most people learn programming by watching and re-reading, which feels like progress and mostly isn't. Learning research has firmer answers than you might expect. Six habits, each with the study behind it.

01

Deliberate practice

Practise just beyond what you can already do, with a clear goal and fast feedback, then repeat what failed. Ericsson and colleagues (1993) argued this kind of practice, not hours alone, is what builds expertise. A later meta-analysis found practice matters but explains less than claimed: about 26% of the differences in games, 21% in music, 18% in sports and 4% in education. Quality and focus count more than the clock.

Do this

  • Pick one narrow skill per session, like looping over an array.
  • Do five small problems that are slightly too hard.
  • Check each against tests, then redo the ones you missed without looking.

Ericsson, Krampe & Tesch-Römer (1993), Psychological Review · Macnamara, Hambrick & Oswald (2014), Psychological Science

02

Retrieval practice

Pulling an answer out of memory strengthens it far more than reading it again. In Roediger and Karpicke (2006), students who practised recalling a passage remembered 61% of it a week later; students who only re-read it remembered 40%, even though they had read it about four times as often (14.2 readings against 3.4).

Do this

  • Close the tutorial and rebuild the example from memory.
  • Answer each chapter's Recall cards before opening them.
  • Explain a concept out loud, then check what you missed.

Roediger & Karpicke (2006), Psychological Science

03

Spaced repetition

Spreading practice over days beats cramming the same amount into one sitting. A meta-analysis of 839 comparisons from 317 experiments (Cepeda et al., 2006) found the best gap between reviews grows with how long you want to remember. A review of ten study techniques (Dunlosky et al., 2013) rated practice testing and spaced practice the only two with high utility; rereading and highlighting rated low.

Do this

  • Review new material after 1 day, 3 days, a week, then a month.
  • Keep syntax and concepts in a flashcard app with spaced scheduling.
  • Re-solve old exercises cold every few weeks.

Cepeda, Pashler, Vul, Wixted & Rohrer (2006), Psychological Bulletin · Dunlosky et al. (2013), Psychological Science in the Public Interest

04

Build projects

What you produce yourself is remembered better than what you read: psychologists call it the generation effect (Slamecka & Graf, 1978). Projects make you generate everything: decide, combine, get stuck, debug. Following tutorials without building anything of your own feels productive and teaches little. Programmers call that tutorial hell.

Do this

  • After every tutorial, build a variation without it open.
  • Keep one small project going and add a feature each week.
  • Climb the project ladder below in order.

Slamecka & Graf (1978), J. Experimental Psychology: Human Learning and Memory

05

Read code

Professionals spend most of their time understanding code, not writing it: about 58% in a field study of 78 developers over 3,148 working hours (Xia et al., 2018). Studying worked examples also helps beginners learn faster than solving everything from scratch (Atkinson et al., 2000).

Do this

  • Read one short function from a well-known project each week.
  • Predict what it does before you run it, then check.
  • Read your own code from a month ago and improve it.

Xia, Bao, Lo, Xing, Hassan & Li (2018), IEEE Transactions on Software Engineering · Atkinson, Derry, Renkl & Wortham (2000), Review of Educational Research

06

Debug on purpose

Debugging is a skill of its own, and it can be taught. A review of the research (McCauley et al., 2008) found novices often lack a systematic strategy: they change code at random instead of testing a hypothesis. Every bug you track down teaches you how the system really works.

Do this

  • Reproduce the bug, then guess the cause before touching anything.
  • Test one guess at a time, with a print or a breakpoint.
  • Keep a bug journal: the symptom, the cause, the fix.

McCauley, Fitzgerald, Lewandowski, Murphy, Simon, Thomas & Zander (2008), Computer Science Education

A week that uses all of it

About six and a half hours. Short and regular beats long and rare: that is the spacing effect at work.

  1. Mon60 minLearn one new idea: one lesson, and run every example.
  2. Tue60 minDeliberate practice: exercises just beyond comfort.
  3. Wed20 minRecall: flashcards, plus one old exercise solved from memory.
  4. Thu75 minProject: add one feature to what you're building.
  5. Fri30 minRead code: one real function. Explain it out loud.
  6. Sat120 minProject and debugging. Write a bug-journal entry.
  7. Sun10 minRest. A quick review of the week's cards.

How long it takes, honestly

  1. WeeksWrite small programs with variables, loops and functions, if you practise a few hours a week. Chapters 1–4 here.
  2. MonthsBuild working apps: a to-do list, something that calls an API. Course estimates for this stage run to hundreds of hours: freeCodeCamp puts each of its certifications at about 300 hours, and Harvard's CS50 tells students to budget 10–20 hours for each week's problem set.
  3. About a year+Job-ready for many junior roles, with a portfolio of real projects. There is no trustworthy average: it depends on your background, the hours you can give and the job market. Be wary of anyone who promises a job in weeks.
  4. YearsExpertise. Peter Norvig's well-known essay argues it takes about ten years to get really good at programming, as at most skills. That's not a reason to wait: you'll be building useful things long before.

freeCodeCamp: each certification takes about 300 hours · CS50x FAQs: 10–20 hours per problem set · Peter Norvig, Teach Yourself Programming in Ten Years

THE PROJECT LADDER

Build these, in this order

Each rung adds one or two new ideas to everything below it. Build each one yourself, without a tutorial open, before you climb.

  1. 1A calculator or unit converterinput, arithmetic, output, variablesch 1ch 2
  2. 2A number-guessing gameloops, conditions, random numbersch 3
  3. 3A to-do list in the browserfunctions, arrays, the DOM, saving to localStoragech 4ch 5
  4. 4A flashcard app with spaced reviewobjects, dates, sorting, and a learning method you'll usech 5ch 6ch 7
  5. 5A weather dashboard on a public APIfetch, async/await, JSON, handling errorsch 8ch 9ch 12
  6. 6Your own REST API, with testsHTTP, routes, validation, unit testsch 8ch 12ch 13
  7. 7Add a real databaseSQL, schemas, indexes, migrationsch 11
  8. 8Accounts and loginpassword hashing, sessions, injection and the OWASP Top 10ch 15
  9. 9Ship itgit, a CI pipeline, deploying to the cloud, logs and metricsch 16
  10. 10Real-time chat or a URL shortener at scaleWebSockets or queues, caching, load testing, failurech 10ch 13ch 14

THE BEST FREE RESOURCES

Where to learn

A short list, not a long one. Pick one course and finish it before collecting more.

Start here

Free, well maintained, written for beginners.

  • COURSE · FREEHarvard CS50xHarvard University · David J. MalanThe best-known intro to computer science: C, Python, SQL and the web, with real problem sets. Free to audit.
  • DOCS · FREEMDN: Learn web developmentMozillaHTML, CSS and JavaScript from zero, by the reference every web developer uses.
  • DOCS · FREEThe Python TutorialPython Software FoundationPython's own tutorial: short, exact, and a good second language.
  • DOCS · FREEjavascript.infoIlya KantorThe modern JavaScript tutorial, from basics to the event loop, with tasks after each part.
  • BOOK · FREEEloquent JavaScriptMarijn HaverbekeA beautifully written book that teaches programming, not just a language. Free online.

Full curricula

Months of structured work, with projects.

Computer science

The ideas under every language.

Practice

Reps, feedback and puzzles.

  • PRACTICE · FREEExercismExercises in 70+ languages with free human mentoring. Ideal for deliberate practice.
  • PRACTICENeetCodeA roadmap of algorithm problems grouped by pattern, each with a video solution. Core list free.
  • PRACTICELeetCodeThe big bank of algorithm problems used for interview prep. Many free; some paid.
  • PRACTICE · FREEAdvent of CodeEric WastlTwenty-five puzzles every December, any language. The archive goes back to 2015.
  • PRACTICE · FREEProject EulerMaths-flavoured programming problems that reward clever algorithms.

Systems and architecture

For when your programs meet the real world.

  • BOOK · PAIDDesigning Data-Intensive ApplicationsMartin Kleppmann · O'ReillyThe book on databases, replication, streams and distributed systems. Paid, and worth it.
  • ARTICLE · FREEroadmap.shCommunity maps of what to learn, and in what order, for front-end, back-end, DevOps and more.
  • BOOK · FREEPro GitScott Chacon and Ben StraubThe official git book, free online.

Tools that show you

Make the invisible visible.

ON THIS SITE

See the machine underneath