Chapter 13. Programming Fundamentals in the AI Era: TypeScript and Python
In this section
- Chapter 13. Programming Fundamentals in the AI Era: TypeScript and PythonRead, predict, run, test and change the code a coding agent wrote, in TypeScript and Python: values and types, decisions and loops, functions, lists and dictionaries, text, dates and files, errors, tests first, and judgment.
- 13.1 You read, the agent writesWhy you read the code an agent writes, why you predict before you run, and five steps for learning to read code.
- 13.2 The workbenchWhat the tests, the type checker and the linter each check, why they run in strict mode, and what the commands the agent asks to run do.
- 13.3 Values, types and variablesHow to make a variable in TypeScript and Python, what kinds of value it can hold, how a list and an array compare, why text from a file is not a number, and why money is kept in whole cents.
- 13.4 Decisions and repetitionHow to find each decision and loop in agent-written code, say it as a sentence, and catch the empty value that slips through.
- 13.5 Functions: the signature is the contractHow to read a function's signature as its promise, test it with one assertion you can check by hand, and why every number comes from a tested function.
- 13.6 Lists and dictionariesWhat a lookup does with a missing key, and what a sort compares.
- 13.7 Text, dates and filesThe hidden rules in text and dates: line endings, files, ISO dates, month and year ends, leap days and time zones.
- 13.8 When it breaks: reading an errorHow to read a Python traceback and a Node stack trace, find the first line in your own code, and name the cause in one sentence.
- 13.9 Tests first: the TDG loopDecide the cases and their answers first, have the agent write them as tests and then the code that passes them, and know what passing does and does not show.
- 13.10 JudgmentWhen your check is enough and when to read the rule lines, how to red-team your tests, and how to turn a vague goal into tests.
- 13.11 How today's tools realize itWhere Claude Code, Codex and OpenCode differ when they ask before acting, reach the network, plan and review, and the differences that change a decision, as their own pages said on October 30, 2026.
- Lab 13: the due-date calculator in two languagesChapter 13's lab: test and generate a due-date calculator in TypeScript and Python, reconcile an export, read an error, and port one tests-first change to one or two more agents.
- Check yourselfRecall and practice for the whole chapter: the flashcards, and a final quiz round from all eleven concepts.