Index
Lesson Index
304 lessons in the 17 courses the catalog lists, a program’s levels each one. Looking for something specific? Search and filter the catalog.
Advanced Git
- Finding Regressions with git bisectBinary-search your history to the exact commit that broke something, then automate it with git bisect run, the exit-code contract, skip, terms, and replay.
- Git in CI/CD PipelinesMake Git behave inside automation: shallow detached-HEAD checkouts and their four symptoms, diffing against the right base, porcelain output, credentials, and bot commits.
- Git Notes, Archives, and BundlesMove what Git stores somewhere else: notes for metadata that cannot change a hash, archive for clean tarballs, bundle for a repository in one file, and custom subcommands.
- Inside the Git Object ModelOpen .git with plumbing commands: blobs, trees, commits and tags, how a hash is computed, refs as files, revision syntax as graph arithmetic, and building a commit by hand.
- Merge Strategies, Drivers, and rerereControl exactly how Git resolves a merge: ort and the other strategies, -s ours versus -X ours, custom merge drivers in .gitattributes, and rerere for recurring conflicts.
- Rewriting History at ScaleA runbook for purging a secret or a huge binary from every commit with git filter-repo, extracting a subdirectory, and coordinating the force-push without breaking the team.
- Scaling Git for Large RepositoriesDiagnose why a repository is slow — too much history, too many files, or too much binary — then apply partial clones, sparse checkout, git maintenance, or Git LFS.
- Securing Your History with Signed CommitsMake every commit cryptographically attributable. SSH and GPG signing, allowed_signers, signed tags, host-side enforcement, and an honest account of what signing does not prove.
- Submodules and SubtreesSeveral repositories, one build. Gitlinks and .gitmodules, the full submodule lifecycle and its honest list of pain, subtrees as the alternative, and when a registry beats both.
- Working on Two Branches at Oncegit worktree: several working directories over one object database. How it works underneath, the failure modes, and the patterns worth adopting — without a second clone.
Advanced Python
- Async I/O in AngerAsync context managers and iterators, connection pools, backpressure when producers outrun consumers, and bridging sync and async code without deadlocking.
- Asyncio from the Event Loop UpCoroutines, tasks and the loop that drives them, what await actually suspends, and the single blocking call that stalls an entire async application.
- Attribute Lookup and the MROHow Python finds an attribute, C3 linearisation, what super actually does in cooperative multiple inheritance, and what __slots__ changes about all of it.
- Concurrency with Threads and Processesconcurrent.futures as the common interface, processes and the pickling constraint, sharing state safely, and the deadlocks that come from getting either wrong.
- Descriptors and PropertiesWhat property is built from, the descriptor protocol underneath it, and using it deliberately for validation, laziness and computed attributes without turning a class into magic.
- Distributing and VersioningWheels and source distributions, native dependencies and the platforms they force you to build for, publishing safely, and the supply-chain concerns that come with being a dependency.
- Memory, Reference Counting, and Garbage CollectionWhen an object is actually freed, the cycles reference counting cannot collect, weak references, and why measuring memory in Python is harder than it looks.
- Metaclasses and Class CreationWhat happens when a class statement executes, why __init_subclass__ and decorators solve most of what people reach for metaclasses to do, and the narrow cases that genuinely need one.
- Metaprogramming and Its Limitsinspect, ast and code generation; why eval and exec are almost never the answer; and recognising the point where clever machinery costs more than the duplication it removed.
- Performance EngineeringWorking from a profile: algorithmic wins first, then data structures, then the boundary where native code or vectorisation is the honest answer — with the measurement to justify it.
- Structured Concurrency and CancellationTask groups that cannot leak a task, timeouts that actually stop work, and treating CancelledError as control flow rather than an error to swallow.
- The Data Model and Dunder MethodsThe protocols behind Python's syntax: how len, in, iteration, comparison and arithmetic are all method calls, and how implementing them makes your types behave like built-in ones.
- The GIL and What It Really BlocksWhat the global interpreter lock does and does not prevent, why threads still help for I/O, what free-threaded builds change, and how to choose between the models on evidence.
- The Import SystemFinders, loaders and sys.path; packages and namespace packages; circular imports and the restructuring that fixes them; and deferring an expensive import without hiding it.
- Typing at the Advanced LevelProtocols for structural typing, TypeVar and ParamSpec, overloads, variance, Self, and writing annotations that make a checker prove something rather than nod along.
- Writing a Library Others Depend OnDesigning a public surface you can live with: what to expose, deprecation that gives people time, semantic versioning applied honestly, and shipping types with your package.
Advanced Testing
- Contract Testing Between ServicesEnd-to-end tests across ten services do not scale. Consumer expectations verified against the provider, where the broker fits, and what contract tests deliberately do not cover.
- Designing a Test StrategyA strategy is a set of decisions about where confidence comes from and what you are willing not to know. Writing one for a real system, and the trade-offs it has to name.
- Ephemeral Environments and Test InfrastructureTest infrastructure is a product with users. Environments created per branch and destroyed after, seeding them quickly, and why a shared staging box becomes a queue.
- Fuzzing and Generated InputFeeding a program input nobody would write, on purpose. Coverage-guided fuzzing, corpora, sanitisers, and turning a crash into a permanent regression test.
- Leading Quality in a TeamQuality as an engineering-wide property rather than a department. Where a QA specialist adds most, coaching over gatekeeping, and making the case with evidence.
- Mutation TestingWho tests the tests? Deliberately breaking the code to see whether anything fails, reading a surviving mutant, and the cost that keeps this off every pipeline.
- Observability as a Testing ToolThe system tells you what your tests could not. Assertions on telemetry, service level objectives as continuous tests, and closing the loop from an incident back to a test case.
- Performance Testing and Load ModelsA load test is only as good as its model of a user. Arrival rates, think time, percentiles over averages, open versus closed models, and finding the knee rather than a number.
- Property-Based TestingStop writing examples and state the invariant instead. Generators, shrinking, choosing properties that hold, and the class of bug that example-based tests structurally cannot find.
- Quality Gates and Release DecisionsTurning test results into a decision: which gates block, which only inform, what happens on a red main, and why an unreliable gate is worse than no gate.
- Risk-Based TestingTesting effort is a budget. Modelling likelihood against impact, spending on the parts that would actually hurt, and defending the choice when someone asks why an area is thin.
- Scaling a Suite: Parallelism and ShardingAn hour-long suite gets skipped. Parallel workers, sharding, test selection by impact, and the isolation guarantees you need before any of it is safe.
- Security Testing for EngineersThe testable part of security: authorisation matrices, injection at every boundary, dependency and secret scanning, and the difference between a scan and a pentest.
- Testing for Resilience and FailureInjecting the failures production will deliver anyway: latency, partitions, dependency outages and clock skew. Running an experiment with a hypothesis and a blast radius.
- Testing in Production SafelySome things are only true in production. Feature flags, canaries, shadow traffic, synthetic journeys and a rollback you have actually rehearsed.
- Testing Non-Deterministic SystemsWhen the same input gives a different answer, equality assertions stop working. Scoring instead of matching, thresholds over sample sets, and detecting drift.
AI Engineering Foundations
- Few-Shot Examples That TeachWhen showing beats telling, how to choose examples that generalise instead of ones the model copies verbatim, and how a badly-chosen example set narrows the model instead of guiding it.
- Giving the Model Your DataThe decision map every AI feature runs into: put it in the prompt, retrieve it at query time, give the model a tool to fetch it, or train it in. What each option costs and which problems it actually solves.
- Measuring Instead of VibingYour first evaluation: a fixed set of real inputs, an expected outcome for each, and a number you can compare. How to build one in an afternoon and why prompt tuning without it is guessing.
- Sampling, Temperature, and Non-DeterminismWhy a model that is deterministic underneath gives you different answers anyway: temperature, top-p, seeds, and how to decide when variation is a feature and when it is a bug you have to design around.
- Structured Output Instead of ProseWhy parsing a model's paragraphs is a bug factory, and how asking for a schema instead turns an AI call into an ordinary function you can type, validate and test.
- System Prompts and Rules FilesThe durable instruction layer that sits above every request: what belongs in it, what does not, and why project rules files have become a standard part of working with AI tools regardless of vendor.
- The Shape of an AI FeatureAssembling everything so far into one small end-to-end feature — input handling, prompt, schema, validation, fallback and evaluation — and seeing which parts are AI and which are ordinary software.
- Tokens, Context, and Why They Cost YouHow text becomes tokens, what a context window really limits, and why input and output are priced and paced differently. Counting tokens before they surprise you, and what happens when you run out of room.
- What a Language Model Actually DoesNext-token prediction, and how that one mechanism explains almost every behaviour you will meet: fluency without understanding, confidence when wrong, and why the same question can get two different answers.
- What to Never Hand a ModelSecrets, personal data, and irreversible actions: the categories that need a boundary rather than a careful prompt, plus what retention and training policies mean for data you send to a provider.
- Why Models HallucinateThe mechanism behind confident invention, why asking a model to be accurate does not make it accurate, and the three things that genuinely reduce it: grounding, permission to refuse, and verifiable citations.
- Writing a Prompt That Holds UpThe four parts of a prompt that survives contact with real inputs — instruction, context, examples, output contract — and the vague, overloaded and politely-worded prompts that quietly fail.
Building Reliable AI Systems
- Cost and Latency EngineeringPrompt caching, model routing, batching, streaming for perceived speed, and trimming context that earns nothing. Where the money actually goes, measured rather than assumed.
- Designing the Context WindowContext is a budget, not a bucket. What to include, in what order, and why adding more relevant material can make answers worse rather than better.
- Designing Tools a Model Can Use WellA tool description is a prompt. Naming, granularity, argument shape, error messages that teach the model to recover, and why fewer sharper tools beat a large flexible one.
- Evaluating an AI FeatureGolden sets, rubrics, and regression suites that run in CI. Choosing metrics that move when quality moves, and keeping an evaluation honest as the feature it measures changes.
- Failure Modes, Retries, and FallbacksTimeouts, rate limits, content filters, truncated output and provider outages — which are worth retrying, which need a different model, and which must surface to the user immediately.
- Grounding and CitationMaking an answer traceable to its source, forcing a refusal when the sources do not support one, and checking citations mechanically instead of trusting that they exist.
- Memory and State Across TurnsWhat to carry between turns and what to drop: rolling summaries, durable facts, retrieval over past conversation, and the failure where a stale memory outranks the truth in front of it.
- Observability for Non-Deterministic SystemsTracing a request through prompts, tools and retries; logging enough to reproduce a bad answer without logging things you should not keep; and watching cost and latency as first-class signals.
- Prompt Injection and the Trust BoundaryEvery document, web page and tool result is untrusted input that reaches the same context as your instructions. Where the boundary goes, least privilege for tools, and confirming side effects with a human.
- Retrieval That Actually RetrievesWhy naive vector search disappoints: chunking that destroys meaning, embeddings that miss exact terms, and no reranking. Hybrid retrieval, chunk design, and measuring recall before you blame the model.
- Shipping an AI Feature SafelyRolling out something you cannot fully predict: flags, canaries, a kill switch, a feedback path from users back into your evaluation set, and what to do the first time it embarrasses you.
- Skills and Reusable CapabilityPackaging instructions, examples and assets into named units the model loads only when relevant. Progressive disclosure, when a skill beats a bigger system prompt, and how to keep a library of them from rotting.
- Structured Output You Can TrustSchema-constrained generation, validating at the boundary, repair loops that converge instead of looping forever, and handling partial objects while a response is still streaming.
- The Agent LoopThink, act, observe, repeat — and the four termination conditions that stop it running away. Step budgets, progress detection, and why an agent that cannot stop is worse than one that cannot start.
- Tools the Model Can CallHow tool calling actually works — schema, invocation, result, continuation — and what to do about the model calling the wrong tool, the right tool with wrong arguments, or no tool at all.
Docker Foundations
- Configuration and Environment VariablesOne image, many environments. Passing configuration in at run time with environment variables and env files, and why a secret baked into an image is a secret you have leaked.
- Debugging a Container That Will Not StartA method for the five failures you will actually hit: exited immediately, port already allocated, image not found, permission denied, and the container that runs but answers nothing.
- Images, Containers and the DifferenceAn image is a recipe and a container is the meal. Why that distinction explains almost every confusing thing Docker does, plus the commands to inspect both.
- Installing Docker and Running Your First ContainerGet Docker onto macOS, Windows or Linux, prove it works, and run something real in one command — then look at what actually happened underneath.
- Keeping Data With VolumesContainers forget everything when they stop. Bind mounts, named volumes and tmpfs — which one to reach for, and the mistake that silently loses a database.
- Layers, Caching and Build ContextWhy your second build is instant and your third is not. How layers are cached, why instruction order decides your build time, and what .dockerignore is really for.
- Networking and Publishing PortsWhy localhost inside a container is not your localhost. Publishing ports, user-defined networks, and how one container finds another by name.
- Publishing an Image to a RegistryTagging, logging in and pushing to Docker Hub or GitHub Container Registry, plus what a tag really is and why :latest is the one you should not depend on.
- Running a Multi-Container App With ComposeA web app, a database and a cache started with one command. Writing compose.yaml, service dependencies, and the difference between up, down and down --volumes.
- Smaller, Safer ImagesMulti-stage builds, choosing a base image, dropping root and pinning versions — the four changes that turn a 1.2 GB image with a shell in it into something you would ship.
- Why Containers ExistThe problem containers solve, told through the machine that worked and the one that did not: what a container actually is, how it differs from a virtual machine, and why the answer is a shipping metaphor.
- Writing Your First DockerfileBuild your own image from a text file: FROM, WORKDIR, COPY, RUN and CMD, each introduced by the problem it solves, ending with an application you built and ran yourself.
- Your First Containerised AppThe capstone: take a small application from bare source to a built, configured, published image running behind Compose with persistent data — every step from the earlier lessons in one pass.
Git Fundamentals
- Branching and Merging BasicsBranches as movable labels, switching without losing work, fast-forward versus three-way merges, resolving your first conflict, and cleaning up merged branches.
- Choosing What Git TracksKeep your repository to source and nothing else. .gitignore pattern syntax, why ignoring a tracked file does nothing, git rm --cached, check-ignore, and global ignores.
- Configuring Git the Way You Want ItThe three config levels, your editor, line endings, and the handful of settings that remove daily friction — each introduced by the annoyance it fixes.
- Installing GitGet Git onto your machine and teach it who you are. Includes a short orientation to the terminal for anyone who has never opened one, and why Git needs your name at all.
- Reading What ChangedAnswer what is different and who changed this line. git diff and --staged, reading a unified diff hunk by hunk, commit references, git show, log filtering, and blame.
- Undoing Things SafelyA decision guide for every common mess: restore, clean, amend, reset soft/mixed/hard, revert, and reflog rescue — with a clear line between what is recoverable and what is not.
- Why Version Control ExistsWhat Git actually stores and why its workflow is shaped the way it is: snapshots, commit hashes, history as a graph, and why every clone is a full copy.
- Working with Remotes and GitHubBack your work up and share it. Clone versus remote add, SSH keys and tokens, upstream tracking, what origin/main really is, fetch versus pull, and the rejected push.
- Your First Repository and CommitBuild a real repository from scratch. The .git directory, the three areas, reading git status, staging with add and add -p, and writing commit messages worth keeping.
Git in Practice
- Automating Git with HooksMake the repository catch its own mistakes. Every hook worth knowing, two complete scripts you can paste, core.hooksPath so they travel with a clone, hook managers, and why hooks are not enforcement.
- Branching Models for TeamsGitHub Flow, trunk-based development and Git Flow compared honestly, plus release and hotfix branches, the real cost of long-lived branches, and how to keep one current.
- Cherry-picking and Moving CommitsCopy a commit onto another branch and live with the duplicate: ranges, -x for backports, conflict handling, patch-id detection, and moving work with format-patch when there is no shared remote.
- .Gitattributes and Config That Pays for ItselfThe committed half of Git automation: line endings, diff and merge drivers, linguist attributes, export-ignore, plus conditional includes and the settings that remove daily friction.
- Interactive Rebase and Clean CommitsTurn a messy branch into commits a reviewer will thank you for. Every todo verb, splitting a commit, the --fixup and --autosquash workflow, and rebase --exec.
- Merging and Resolving ConflictsHandle a genuinely hairy merge with a process rather than luck: the merge base, zdiff3 conflict style, modify/delete and rename conflicts, and verifying a merge before you trust it.
- Pull Requests and Code ReviewThe pull request lifecycle end to end, the three merge buttons and what each does to history, reviewing locally, git range-diff, force-pushing under review, CODEOWNERS and forks.
- Recovering Lost Work with the ReflogA rescue manual organised by symptom: bad reset, deleted branch, botched rebase, lost amend, dropped stash — plus git fsck, and the one category of loss that is permanent.
- Rewriting History with RebaseWhat rebase actually does to your commits, merge versus rebase as a real trade-off, the ours/theirs inversion, rebase --onto, and force-pushing with --force-with-lease.
- Stashing Work in ProgressPut work down safely and pick it up again: push with a message, apply versus pop, the untracked-file trap, partial stashes, what a stash really is, and recovering a dropped one.
- Tags, Releases, and VersioningCut a release that is reproducible a year later. Annotated versus lightweight tags, pushing and never moving tags, git describe, semantic versioning, and changelogs from history.
Kubernetes Foundations
- A Cluster on Your LaptopInstall kind or minikube, get kubectl talking to it, and understand the kubeconfig file well enough never to deploy into the wrong cluster.
- ConfigMaps and SecretsGetting configuration into a pod as environment variables or mounted files, and the honest truth about how much protection a Secret does and does not give you.
- Debugging a Pod That Will Not RunA method for Pending, ImagePullBackOff, CrashLoopBackOff and the pod that is Running but wrong — describe, events, logs, previous logs, exec, and what each one tells you.
- Deployments That Keep Pods RunningThe controller you actually use. Replicas, the ReplicaSet underneath, scaling up and down, and what happens when you delete a pod a Deployment owns.
- Ingress and Getting Traffic InOne entry point, many services. Ingress rules, hostnames and paths, TLS termination, and why an Ingress does nothing without a controller behind it.
- Labels, Selectors and NamespacesHow Kubernetes groups things without a hierarchy: labels as the glue every controller uses, selectors as the query, and namespaces as the boundary around a whole environment.
- Manifests and kubectl applyYAML as the interface: apiVersion, kind, metadata and spec, the difference between apply and create, and why declaring the end state beats issuing commands.
- Persistent Storage for Your DataPods are disposable and disks are not. PersistentVolumes, claims, StorageClasses and access modes — enough to run something stateful without losing it.
- Pods, the Smallest Unit You DeployKubernetes never runs a container on its own. What a pod adds, why sidecars share one, and why you will almost never create one by hand.
- Probes, Restarts and Self-HealingLiveness, readiness and startup probes: how the cluster decides your app is alive, ready for traffic, or beyond saving — and what a badly written probe costs.
- Requests, Limits and SchedulingWhy a pod sits Pending forever, and why another one keeps getting killed. CPU and memory requests versus limits, OOMKilled, and how the scheduler places work.
- Rolling Updates and RollbacksShipping a new version without dropping a request: rollout strategy, maxSurge and maxUnavailable, watching a rollout, and undoing one that went wrong.
- Services and Reaching Your PodsPod IPs change constantly, so nothing addresses them directly. ClusterIP, NodePort and LoadBalancer, cluster DNS, and how a Service finds its pods.
- What a Cluster Is Made OfControl plane, nodes, kubelet, scheduler and etcd, explained as one loop: you write down what you want, and something keeps reality matching it.
- Why Kubernetes ExistsYou can run containers with Compose, so why is there a cluster? The failures Kubernetes was built to absorb — a dead machine, a traffic spike, a bad deploy — and the declarative idea underneath all of it.
- Your First App on KubernetesThe capstone: take the container you built earlier and give it a Deployment, a Service, configuration, storage, probes and an Ingress — then update it and roll it back.
Production AI Engineering
- An Eval Harness You Can TrustBuilding an evaluation you would bet a release on: sample size, variance across runs, statistical significance, and why a two-point score improvement is usually noise.
- Caching Across a Model StackPrompt caching and its layout rules, semantic caching and its correctness risk, and invalidation in a system where the same input may legitimately produce a different answer tomorrow.
- Context Engineering at ScaleLong contexts degrade in ways short ones do not. Compaction, hierarchical summarisation, isolating work in sub-agents with their own context, and measuring attention loss instead of assuming it away.
- Drift, Regression, and Model UpgradesWhy a better model breaks your prompts, how to pin and how to move, shadow traffic, and an upgrade playbook that turns a scary migration into a measured one.
- Fine-Tuning, Distillation, and When Not ToA decision framework: what fine-tuning fixes, what it never fixes, the data and evaluation it demands, and the maintenance cost that arrives the day the base model is deprecated.
- Guardrails and Policy EnforcementInput and output filters, allowlists, and classifiers — where each belongs in the stack, what they genuinely stop, and why a guardrail that runs on the same model it guards is not a control.
- Human-in-the-Loop DesignApproval gates, confidence thresholds and escalation paths that fit real work. Designing against reviewer fatigue, where rubber-stamping makes the human a liability rather than a control.
- Incidents in Non-Deterministic SystemsResponding when there is no stack trace: reproducing from traces, replaying a request, rolling back a prompt, and writing a postmortem whose root cause is a probability rather than a line of code.
- LLM-as-Judge and Its Failure ModesPosition bias, self-preference, verbosity bias and miscalibration. How to build a judge that correlates with human labels, and how to know when it has stopped.
- Model Context Protocol and Tool EcosystemsAn open standard for connecting models to tools and data: servers, clients, transports, and what changes about your threat model once a third party can define the tools your agent sees.
- Multi-Agent OrchestrationWhen splitting work across agents genuinely helps and when it is expensive theatre. Fan-out and verify, adversarial review, coordination failure, and the token cost nobody budgets for.
- Routing and Model PortfoliosCascades, confidence signals and cheap-first strategies; abstracting over providers without abstracting away the differences that matter; and measuring whether routing actually saved anything.
- The AI Threat ModelIndirect injection chains, exfiltration through tool arguments, the confused deputy, and a supply chain that now includes prompts and skills. Defence in depth for systems that will be attacked through their inputs.
- The Economics of an AI ProductUnit economics per request, margin as a design constraint, abuse and capacity planning, and how cost pressure quietly reshapes architecture whether or not you plan for it.
Python Foundations
- ComprehensionsBuilding a list, dict or set from another in one readable line — and recognising the point where a comprehension has become worse than the loop it replaced.
- Dictionaries and SetsLooking things up by name instead of position, handling a key that is not there, and using a set when membership and uniqueness are the whole point.
- Functions, Arguments, and Return ValuesNaming a piece of work so you can reuse it: parameters, defaults, returning values, and the mutable default argument that catches every Python programmer exactly once.
- Installing Python Without Breaking Your MachineWhy your computer may already have a Python you should not use, how versions coexist, and getting to a working setup you can trust on macOS, Windows or Linux.
- Lists and TuplesOrdered collections you can change and ones you cannot: indexing, slicing, growing a list, and the aliasing surprise where two names turn out to share one list.
- Loops That Do Not Run AwayRepeating work over a collection, repeating until something changes, and the loops that never finish. enumerate and zip, and why you rarely need an index in Python.
- Making Decisions with Conditionsif, elif and else; comparison versus equality; what Python considers true when the thing is not a boolean; and combining conditions without creating something nobody can read.
- Numbers and Arithmetic That Surprises YouIntegers that grow without limit, decimals that cannot represent 0.1 exactly, floor division and modulo, and when money needs a different type altogether.
- Objects and ClassesThe problem classes solve — data and the behaviour that belongs to it in one place — how to write one, and the many cases where a function and a dictionary are the better answer.
- Organising Code into ModulesSplitting one long file into several that import each other, what the if __name__ line is really doing, and a project layout that will not fight you later.
- Reading and Writing FilesOpening files so they always close, text versus bytes, encodings and the errors they cause, and building paths that work on any operating system.
- Strings and TextBuilding and shaping text: f-strings, the string methods worth memorising, why a string can never be changed in place, and what happens when text is not plain English.
- The Standard Library You Will Actually UseA tour of what ships with Python and saves you writing it: pathlib, datetime, json, collections, itertools, random and argparse, each shown solving a real task.
- Values, Names, and TypesWhat a variable really is in Python — a name attached to a value, not a box holding one — plus the basic types, why the distinction between them matters, and what None is for.
- When Things Go Wrong: ExceptionsReading a traceback, catching only what you can handle, and why except Exception hides the bug you most needed to see. try, except, else and finally, and raising your own.
- Why Python and What Happens When You Run ItWhat a programming language is for, what actually happens between saving a file and seeing output, and the difference between typing at the interpreter and writing a program that lasts.
- Your First Real Python ProgramBuilding a small command-line tool end to end: arguments, files, error handling, structure and a first test — putting every earlier lesson into one thing that works.
Python in Practice
- Code Quality ToolingFormatters and linters that end style arguments, pre-commit hooks that catch problems before review, and wiring the same checks into CI so they cannot be skipped.
- Configuration and SecretsLayering defaults, files and environment variables; validating configuration at startup so it fails immediately; and keeping credentials out of your repository for good.
- Context ManagersGuaranteeing cleanup even when something raises: the with statement, contextlib, writing your own, and the resource leaks that appear the moment you do not.
- Dataclasses and Modelling DataReplacing dictionaries-as-records with types that describe themselves. dataclass, frozen instances, post-init validation, and choosing between NamedTuple, TypedDict and a validation library.
- Dates, Times, and Time ZonesNaive versus aware datetimes, storing UTC and displaying local, zoneinfo, and the arithmetic that goes wrong twice a year when clocks change.
- DecoratorsWrapping a function to add behaviour around it: closures, functools.wraps and the debugging misery of forgetting it, decorators that take arguments, and when a decorator is the wrong tool.
- Errors as DesignException hierarchies that let callers catch the right thing, chaining so the original cause survives, and deciding when a failure should raise rather than return.
- Files, Paths, and the Filesystempathlib beyond the basics: globbing, temporary files, atomic writes that survive a crash mid-write, permissions, and why string paths keep breaking on someone else's machine.
- HTTP Clients and Talking to APIsSessions and connection reuse, timeouts you must always set, retries with backoff on the right status codes, pagination, and reading an API error instead of swallowing it.
- Iterators, Generators, and LazinessThe iterator protocol, yield, and pipelines that process a file larger than memory. Where laziness wins, and the bugs that appear when a generator is consumed twice.
- Logging Instead of PrintLevels, loggers and handlers; structured logs you can search; and what must never reach a log line. Configuring logging once, at the edge, instead of everywhere.
- Packaging Your Projectpyproject.toml, the src layout, editable installs and console entry points — turning a folder of scripts into something that can be installed, imported and shipped.
- Profiling Before OptimisingMeasuring where time actually goes: timeit for micro-questions, cProfile for real programs, reading the output, and the optimisation that made everything slower.
- Regular Expressions in ModerationEnough regex to be useful — groups, anchors, greediness, compiled patterns — plus the cases where a parser, a split, or three lines of plain code is the correct answer.
- Subprocesses and the ShellRunning other programs safely: argument lists versus shell strings, capturing and streaming output, exit codes, timeouts, and the injection risk in shell=True.
- Test Doubles and When to MockPatching, fakes and seams. Mocking at the boundary rather than in the middle, and the over-mocked test that passes happily while the code it covers is broken.
- Testing with PytestTests that fail usefully: plain assertions, fixtures, parametrisation, and choosing what to test so the suite catches regressions instead of restating the implementation.
- Type Hints That Earn Their KeepAnnotations a checker can actually use, gradual typing in an untyped codebase, Optional and unions done properly, and the hints that add noise without adding safety.
- Virtual Environments and Dependency ManagementWhy installing packages globally eventually breaks something, what an environment actually is, and how lockfiles turn 'works on my machine' into a reproducible install.
- Working with JSON and External DataParsing data you did not create: validating shape before trusting it, custom encoders, numbers and dates that do not survive a round trip, and failing loudly at the boundary.
Testing Foundations
- Beyond Functional TestingThe requirements nobody writes down: usability, accessibility, compatibility, performance and security. What each one is, and the cheapest first check for each.
- Equivalence Classes and Boundary ValuesYou cannot test every input, so stop trying. Splitting an input space into classes that behave alike, then testing the edges — where bugs genuinely live.
- Exploratory TestingTesting without a script, done properly: charters, time-boxing, note-taking and heuristics. The technique that finds the bugs your written cases were never going to.
- Filing a Bug Report That Gets FixedA minimal reproduction, the expected and actual behaviour, the environment, and one bug per report — the difference between a ticket that gets fixed and one that gets closed.
- How Software BreaksThe failures that actually happen: bad input, missing state, timing, integration seams and wrong assumptions. Knowing the shapes is how you learn to guess where a bug is hiding.
- Levels of TestingUnit, integration, system and end-to-end — what each level can see, what it cannot, and why the pyramid is a statement about cost and speed rather than a rule.
- Regression Testing and Why Suites GrowFixed things break again. Where a regression suite comes from, why every bug should leave a test behind, and how a suite turns into something nobody wants to run.
- Severity, Priority and What Gets Fixed FirstSeverity is how bad it is; priority is when we deal with it. Why the two come apart, who decides each, and how to argue for a fix with evidence instead of feelings.
- Smoke, Sanity and Acceptance TestingThe same software tested for different purposes: is the build worth testing, did this fix work, and would the person who asked for the feature accept it?
- Static Testing and ReviewsThe cheapest defects to fix are the ones found before the code runs. Requirement reviews, code review as testing, and what a linter or type checker is really doing for you.
- Test Data and EnvironmentsMost confusing test results are really data or environment problems. Building the state a test needs, keeping environments comparable, and never testing with real customer data.
- Turning Requirements Into Test CasesRead a feature description, find what it does not say, and turn it into cases someone else can run: preconditions, steps, expected result, and one behaviour per case.
- What Testing Is Actually ForNot to prove software works — that is impossible — but to buy information about risk before your users find it. What a test is, what QA is, and why testing early costs less than testing late.
- When to Automate and When Not ToAutomation is code you now maintain. What it is genuinely good at, what only a human can judge, and how to tell a test worth automating from one that will just break.
- Writing Your First Test PlanThe capstone: for one real feature, write down what you will test, what you will not, in what environment, with what data, and how you will know when you are finished.
- Your First Automated TestWrite, run and read a real automated test: arrange, act, assert; what a good failure message looks like; and why a test that never fails is not a test.
Testing in Practice
- Accessibility Checks in the PipelineWhat an automated audit can catch, the much larger part it cannot, and how to wire the machine-checkable half into CI without pretending the job is done.
- Browser Tests With PlaywrightEnd-to-end tests that are not a liability: auto-waiting instead of sleeps, one user journey per test, tracing a failure, and running the same spec across browsers.
- Bug Triage and Quality MetricsRunning triage so the queue stays meaningful, and choosing measures that survive contact with incentives — escaped defects and time-to-detect over test counts and pass rates.
- Database State and IsolationTests that pass alone and fail together are almost always sharing state. Transactions, truncation, per-test schemas and why ordering dependence is a bug in the suite.
- Faking External ServicesThird-party APIs are slow, rate-limited and occasionally down. Stubs, fakes, recorded responses and local doubles — and how to notice when your fake has drifted from reality.
- Integration Tests and Their SeamsWhere to cut a system so an integration test is both realistic and fast: the seams worth testing across, and the ones that are really end-to-end tests in disguise.
- Killing Flaky TestsA flaky test is a bug report about your suite. The four real causes — timing, shared state, ordering, real non-determinism — how to reproduce each, and why retries are not a fix.
- Locators and Page ObjectsWhy CSS-path selectors break every sprint. Locating elements the way a user finds them, test ids as a deliberate contract, and page objects that help rather than hide.
- Running the Suite in CIGetting from works-on-my-machine to a signal the team trusts: what runs on a pull request versus nightly, caching, artefacts on failure, and keeping the pipeline honest.
- Structuring a Test SuiteHow a suite is laid out decides whether people run it. Naming, grouping, shared setup, the fast/slow split, and keeping the failure message enough to diagnose from.
- Test Data Fixtures and FactoriesShared fixtures rot and duplicated setup hides intent. Factories with sensible defaults, building only what the test is about, and making the interesting value obvious.
- Testing an HTTP APIStatus codes, headers, schemas and error bodies — testing the contract rather than the handler, including the authorisation cases everyone forgets.
- Unit Tests That Earn Their KeepThe difference between testing behaviour and testing implementation, why the second kind fails on every refactor, and how to pick the unit worth isolating.
- Visual and Snapshot TestingCatching the change no assertion describes. Snapshot tests and their rot, visual diffs and their noise, and how to keep either from becoming a rubber stamp.
- What Coverage Does Not Tell YouLine, branch and path coverage, what each measures, and why a 90% number can sit on top of tests that assert nothing. Using coverage as a question, not a target.
TypeScript from Zero · Level 1: TypeScript Foundations
- A catalogue of common TypeScript errors and how to fix themPut the common TypeScript errors in one place, like the few dashboard lights most drivers ever see: tell a message’s family from its first words, read a long message down to its deepest indented line, and decide whether the value or the type is the one to change. Break TaskKit once to see a message name both places.
- A ready-made
tsconfig.json:strict, and the flags that keep TypeScript in sync with NodeMove TaskKit’s long check line into a tsconfig.json, so plain tsc checks every file, tests included. Learn what strict switches on, and the three settings that make the check refuse what Node refuses: a type in a plain import, an enum, and an import path without .ts. anyvsunknown: the escape hatch and the safe boxMeet the two types that take any value and work as opposites: any switches TypeScript’s checks off, while unknown keeps them on until a check says what the value is. Open an unknown with typeof and instanceof, choose the type that keeps TypeScript checking, and give TaskKit’s catch a sentence for anything it catches.- Arithmetic, comparisons, and template stringsWork out new numbers with + - * / and %, and know which goes first. Ask questions with === and < that answer true or false, and see why + joins text instead of adding. Put values into text with template strings, read TS2367, and make TaskKit say how much room is left.
- Arrays and the
T[]typeKeep many values in one array, read any of them by its index counted from 0, and read the type of a list as string[]. Add items with push, see why const still lets a list grow, avoid reading one past the end, and make TaskKit keep the tasks it adds instead of only counting them. - Arrow functionsWrite the rules from lesson 4.3 the long way: an arrow function with typed parameters and a return type, a short body that gives its value back by itself or a body in braces with return, kept in a box and called by its name. See map call an arrow once per item, learn why a rule inside map needs no types, and when to write an arrow rather than a function declaration.
async/awaitWrite an async function that waits for a promise with await and uses its value on the next line. See that an async function always gives back a promise, that await pauses only the function it is written in while the rest of the file goes on, and why await needs async, then rewrite TaskKit’s remind so its wait reads from top to bottom.- Basic types:
string,number,booleanTell a string, a number and a boolean apart, even when they print the same, and write the type on a box with a colon. See why a let box takes a new value but never a new type, read TS2322, and why a number in quotes prints 011 when nothing checks it. - Breaking a problem into small functions, starting from plain-language stepsTurn a problem said in one sentence into plain-language steps, write each step as a line or a small function that answers or does a job, and call them in order from a main function that reads like the plan. TaskKit’s banner and summary become functions of their own.
- Catching what you do not
await:.catchandunknownCatch the error of a call you do not await with the promise's own .catch. See that .catch runs when the promise is rejected, after the lines below it, give its error the type unknown instead of the any it gets, check that error before you read its message, and keep a failing TaskKit reminder from stopping TaskKit. chalk: colors in the terminalSee what a coloured word really is, escape codes the terminal reads as orders, install chalk by name though boxen already brought it, colour and style TaskKit’s messages, and keep the colour in the printed line so the values TaskKit saves, compares and tests stay plain, even when the test runner turns colours on.- Checking for
null: a first look at narrowingCheck a box for null or undefined with if, and read the type TypeScript gives it inside the check, in the else and after the block. See why a check takes away only the nothing it names, and make TaskKit tell a person who typed ADD that commands are lower case. - Checking your work: your first test with
node:testWrite down the right answer once and let a command check it every time: move functions into a file of their own with export, write a test with node:test that calls one with an input whose answer you know, run every test with node --test, and read the + actual / - expected report when one fails. TaskKit’s capitalize and percentFull get their first tests, and Module 5 closes with its one-page cheat sheet. - Classes: properties, constructors, and methodsWrite your first class: properties, a constructor that fills each new object through this, and methods that work on the object before the dot. Then move TaskKit’s list into a TaskStore class.
commander: a real command-line interfaceName the parts of a command line, install commander and describe TaskKit’s add and remind commands with arguments and a --due option, type what an action receives because commander passes any, let commander check every line and write the help, and pass options through npm start with --.- Comments and names: writing code other people can readChoose names that say what a box holds, join their words in camelCase, and see why TypeScript refuses a name that is one capital off. Rename a box on every line at once with F2, write comments that say why rather than what, comment a line out, leave a note the hover shows, and give TaskKit a clearer name.
constandletName a value with const when it is filled once and with let when a later line refills it. Read = as an order, not a comparison: the right side is worked out first. See why TypeScript refuses a refilled const before anything runs, and make TaskKit count the tasks it adds.date-fns: working with due datesSee why a typed word is not a date and where the built-in Date trips you up, install date-fns, turn 2026-10-30 into a real date with parseISO, refuse one that is not a date with isValid, print it with format, and count the days left in calendar days, so TaskKit’s list says due: Fri 30 Oct, in 3 days.- Debugging strategies:
console, breakpoints, isolating the problemFind where a bug with no error message starts: make it happen every time, then halve the lines it can be on with logs that show everything until one line is left. Stop on the one turn of a loop that matters with a conditional breakpoint, fix the bug where it starts rather than where it shows, and keep it fixed with a test. - Declaring functions: parameter and return typesWrite a few lines once and run them whenever you like: declare a function with a name, typed parameters and a return type, call it with arguments, and use the value that return hands back. Follow a call into the body and out again, see why a parameter’s type must always be written, and how TypeScript checks every call, the body and the return against the first line. TaskKit gets its first function, capitalize.
- Destructuring and spread (and why spread is shallow)Take properties out of an object by name and items out of a tuple by place, copy an object or a list with three dots, and change what differs in the same braces. See why a spread copy still shares every list inside it, and copy that list too.
- Dictionaries and collections:
Record,Map, andSetKeep values under names that are data with Record, count with a Map whose get admits a missing key, and keep each value once with a Set. See why a Record’s brackets trust you while a Map’s get makes you write ?? 0, and choose the one a job needs. - Discriminated unionsGive every shape of a union the same property with its own word, like a label on a parcel that says what is inside. Check that word with three equals signs or a switch, see which shape TypeScript gives the value on every branch, tell a trip from a day off, and turn TaskKit’s commands into such a union.
- Enums: reading them in other people's code, and why modern code prefers literal unionsRead an enum in someone else’s code: a list of names, each standing for a value, like dish numbers on a café menu. Say which number or word each member holds, see why TypeScript accepts an enum while Node refuses to run it, and rewrite it as the union of words TaskKit already uses. Closes Module 7 with its one-page cheat sheet.
- Errors in async code:
tryaroundawaitLearn the third state of a promise, rejected, and what await does when the wait goes wrong: it throws the reason on its own line. Make a promise that is rejected, catch its error with try and catch around await, see that a throw in an async function rejects its promise, and find out why a try without await catches nothing. fetch: getting data from a web APIAsk a real weather service for tomorrow’s forecast. Learn what a web API, a URL, a query and a status code are, send a request with fetch and read its JSON body with a second await, give that body a type, and check response.ok so a bad answer is caught by your own code, while no answer at all ends in fetch failed.- Finish TaskKit: add a feature that fetches data from an API, and write a READMELook back at how TaskKit grew, ask the Nager.Date web API whether a due date is a public holiday, check its answer at the edge, let the feature step aside when the network is gone, and write TaskKit’s README in Markdown.
for,for...of, andwhileRun the same lines for every item of a list with for...of, count through its indexes with for and i++, and repeat while a condition holds with while. See why i < tasks.length stops in time where <= does not, why the counter is let, and make TaskKit add several tasks in one command and print them as a numbered list.- Functions as values: callbacks and function typesHand a function over without calling it: keep it in a box, give your own named function to filter, and write a function that takes one and calls it back. See countIf call isCall once for every task, read a function type such as (task: string) => boolean, and learn what TypeScript says when a callback is called instead of handed over.
- Git on your computer: commits and a
.gitignoreInstall Git and the GitHub CLI, tell Git who you are, make the TaskKit folder a repository, keep node_modules and your own task list out of it with a .gitignore, and save TaskKit's first commit. Learn why a commit saves only what you picked with git add, and how to read git status. - Hello, world: running your first
.tsfile (and the online Playground)Write your first TypeScript file in VS Code, save it, and run it with Node from the terminal, from the right folder. Change it and see why an unsaved file prints the old text, write TaskKit's welcome banner, and try code in the online TypeScript Playground. if/elseandswitchMake a program choose which lines run. Ask a condition with if, take the other road with else, ask questions in order with else if, and match one value against exact cases with switch, ending every case with break. See why a box made inside braces is unknown after them, pick one of two values with the conditional operator ? :, and make TaskKit act on its command and answer a missing task with a hint.importandexport:"type": "module",.tsextensions,import typeSplit TaskKit's index.ts into four files that share boxes, functions and types with export and import. Learn the three rules Node follows on every import line: “type”: “module” in package.json, the whole file name with .ts, and import type for a type, which Node strips out before the program runs.- Inference: when TypeScript knows the type and when to write it yourselfSee how TypeScript works out a box’s type from its first value and from every operator and method, why a const box shows its value as a literal type while a let box shows the kind, and when writing the type yourself catches a first value of the wrong kind. Read every type in TaskKit on hover.
- Interactive input with
readlineMake TaskKit ask for its tasks while it runs. Ask a question with readline and wait for the answer with await, see why every answer arrives as a string and why a program that never closes its reader never ends, keep asking until an empty line, and give TaskKit an interactive mode: npm start add with nothing after it asks for the tasks one by one. - Interfaces and
extendsName an object’s outline with interface and build a bigger one on top of it with extends: a PlannedTask is a Task plus minutes. See that an interface is checked like an alias, that TS2739 lists the missing properties, and that a PlannedTask fits wherever a Task is wanted, never the other way round. - Iterating over objects:
Object.keysandObject.entriesGo through every property of an object without naming one: its names with Object.keys, its values with Object.values, and both with Object.entries, taken apart in a loop. See why TypeScript calls each name a string and each value any, and why a name from Object.keys cannot look a value up. - JSON:
parseandstringify, and whyJSON.parsereturnsanyTurn a value into JSON text with JSON.stringify and back with JSON.parse, and see why JSON.parse returns any: TypeScript checks before the text exists, so a typo slips through until you write the type on the box. Learn JSON’s strict rules, why a Map becomes {}, what a SyntaxError from JSON.parse means, and give TaskKit tasksToJson and tasksFromJson. - Literal types and unions of literals (
"todo" | "done")Give a value a type made of a few exact words, like a spreadsheet column with a drop-down of todo and done. See TypeScript refuse a misspelled word before anything runs, read its guess when only a capital letter is wrong, learn why a let box gets string instead, and give every TaskKit task a status. lodash: ready-made helpers, with types from@types/lodashSee why a ready-made helper beats four hand-written sorting rules, install lodash and its description from @types/lodash, read which lodash version that description was written for, import lodash whole the way Node can load it, and sort TaskKit’s list by due date with _.sortBy and keys TypeScript checks, so the late task comes first and a task with no date comes last.- Logical operators, truthy and falsy valuesJoin two questions into one condition with && and ||, turn an answer around with !, and learn the six values a condition reads as false. See why a space and “0” are truthy, why && stops before .trim() can run on a missing task, and make TaskKit refuse a task that is only spaces.
map,filter,find,some, andeveryHand a list a rule as an arrow function and let a method do the loop: map makes a new list, filter keeps some items, find gives back the first match or undefined, and some and every answer yes or no, stopping as soon as they know. See why find needs a check, why the new list must be kept, and make TaskKit refuse a task that is already on the list.- Narrowing with the
inoperatorTell objects of different shapes apart with the in operator, like cards on the fridge where only a chore card has a space for minutes. See which type TypeScript gives the value on each side of the check, add up a week of chores, learn why an optional property lands on both sides, and why !== undefined cannot be the check. - Narrowing with
typeof, equality, and truthinessAsk a value which member of its union it holds, like a till that looks at cash or card before it opens the drawer. Check it with typeof, with three equals signs or as its own condition, see which type TypeScript gives it inside the check and in the else, add up a week of minutes, and avoid the check that quietly loses a zero. - npm and
package.json: installing packages and writing scriptsInstall boxen, the first package TaskKit’s own code calls, and draw the banner with it. See why one install fills node_modules with fourteen packages, tell a dependency from a dev dependency, read the ^ in a version, and save the long check, test and run lines as scripts: npm run check, npm test and npm start. nullandundefinedTell the two kinds of nothing apart: undefined, which JavaScript gives to whatever was never filled, and null, which you write for empty on purpose. Write string | null and string | undefined, see why Number(null) is a quiet 0, and make TaskKit read its words with process.argv.at() so tsc catches a check in the wrong order.- Number pitfalls: NaN, floating point, and MathTurn typed text into a number with Number() and catch NaN with Number.isNaN(), because NaN spreads and never equals itself. See why 1.1 + 2.2 prints 3.3000000000000003, round on purpose with Math.round, floor, ceil and toFixed, read TS2845, and make TaskKit say how full today’s list is.
- Objects and object typesKeep the facts about one task in one value: write an object, read its properties with a dot, and write the object type TypeScript holds every such value against, for a box, a parameter or a whole list. TaskKit’s tasks become objects with an id, a title and a due date.
- Optional and
readonlypropertiesChange a property of an object, mark one a value may leave out with a question mark, and lock one with readonly; see why const keeps the box but not the object inside, and why Node never sees readonly. TaskKit’s tasks get a fixed id and a due date they may leave out. - Optional chaining
?.and nullish coalescing??Use a value that may be missing with ?., which goes round null and undefined instead of calling a method on them, and give the line a default with ??. See why ?? keeps a real 0 that || replaces, and make TaskKit read, tidy and default its task in one line. - Optional, default, and rest parametersLet a call leave an argument out with an optional parameter and check it before use, give a parameter a default value that fills in when nothing comes, and take any number of arguments as one list with a rest parameter. See a call fill each box, learn the order parameters go in, and what TypeScript says when a call brings too few, too many, or the wrong order.
private,#private, andreadonly: TypeScript privacy vs JavaScript privacyKeep a class’s data to itself with private or #, mark what never changes with readonly, and see which lock only TypeScript checks and which one Node keeps too. Then TaskKit’s TaskStore locks its tasks away.Promise<T>Learn what a promise is: an object a function gives back at once, standing for a result still to come, pending until it is fulfilled. Make one with new Promise and resolve, run code with its value in then, read Promise<T> the way you read Array<T>, and give TaskKit a delay() helper and a remind command that waits before it prints.- Reading and writing files:
readFileandwriteFileSave TaskKit’s tasks to a file and read them back on the next run. Write text to a file with writeFile, read it back with readFile and “utf8”, see why a missing file stops the first run with ENOENT and how existsSync prevents it, and give TaskKit a store.ts so a task added today is still on the list tomorrow. - Reading code: tracing a loop by handRead a loop you cannot run by being the computer for a minute: write a trace table with a column for every box and a row for every turn, starting from what each box holds before the loop. Trace the check too, since it runs once more than the body, and use the table to find the exact turn where a loop goes wrong, such as one that reads past the end of its list and prints NaN. Closes Module 4 with a one-page cheat sheet of the whole module.
- Recursion: a function that calls itself (a gentle first look)Write a function that calls itself: a base case it answers alone, a recursive case with a smaller job, a card of its own on the call stack for every call, answers coming back from the smallest call, and the RangeError a missing base case leaves behind.
reduceFold a whole list into one value with reduce: a rule that takes the total so far and the next item, and a start value it begins from. Add up the minutes of a day, add up something about every item, see why each answer comes back as the next total, and why leaving out the start value glues numbers onto text or stops Node on an empty list.- References vs copies: why changing one object changes anotherSee why a second box, a parameter or a list leads to the same object rather than a copy, so a change made through one name is seen through every name. Make a real copy with new braces when a change must not reach the original, and tell the two apart with ===.
- Scope and closures (basics)See which boxes a function can reach from where it is written, then write functions that make functions and keep the boxes they use: a rule maker and a task numberer that remembers its count.
- Self-assessment: are you ready for Level 2?Five small tasks, one for each skill Level 2 builds on, done with every lesson closed: plan with small functions, fix a failing test, read a type error, check data from a web API, and set up packages safely. Learn why rereading feels like knowing, why edge cases come every time, and where to go back for a miss.
- Ship TaskKit: publish it on GitHub with a README and a short demo recordingMake a GitHub account, sign in with the GitHub CLI, publish TaskKit's first commit on GitHub, let a friend clone it, and add a short screen recording to its README. See how a change travels with push and pull.
- Simple tuplesKeep a task and its minutes together in a tuple: an array with a fixed number of places, each with a type of its own. Write the type as [string, number], read each place by its index, and sort, search and add up a whole list of pairs without a task ever losing its minutes. See why TypeScript makes a plain list unless you write the tuple’s type, and what TS2493 means when you count places from 1.
- Sorting and its pitfallsPut a list in order with sort, and avoid its three traps: with no rule it compares everything as text, so 10 comes before 5 and capitals jump ahead; it changes the list itself; and its rule must answer with a number. Write a compare function, (a, b) => a - b, sort words with localeCompare, keep the old order with toSorted, and make TaskKit print its list from A to Z.
- Staying safe: lockfiles, pinned versions, and what a supply-chain attack isSee why a range in package.json can bring a different version tomorrow, read the lockfile’s version, address and fingerprint, install exactly what it names with npm ci, pin a version when you need to, and follow the real attack on chalk of September 2025 to see how a supply-chain attack travels and what a lock does and does not stop.
- Structural typing: shapes, not names; excess property checksSee that TypeScript checks an object by its shape, its properties and their types, never by the name of its type, and why an object literal written straight into a call or a typed box may not bring a property the type does not know. Fix a misspelt optional property instead of hiding it in a box.
- The call stack: what happens when functions call functionsFollow a program through functions that call functions: a call pauses the line that made it, every call gets a frame with its own boxes on the call stack, only the top one runs, and Node’s stack trace is that pile, read downward to the call that handed over a bad value.
- The debugger: stepping through a functionPause your own program in VS Code on a line you choose: set a breakpoint, run Node in a JavaScript Debug Terminal, read the boxes in VARIABLES and the pile in CALL STACK, and step over, into and out of calls to find a bug that prints no error.
- The event loop, in picturesSee where a timer’s callback waits and when it runs: Node runs one thing at a time on the call stack, a callback whose time is up waits in the task queue, and the event loop moves it onto the stack once the stack is empty. Learn why a 0 ms callback runs after the file, why a busy stack makes a callback late, and why a loop that waits for a callback never ends.
throwandtry/catchMake a function refuse a value it cannot work with by throwing an error instead of giving back a fake answer, and catch that error with try and catch so the program carries on. Read the error’s message once you have checked that it is one.- Two tools, two jobs: Node runs your code, TypeScript checks itSee why node runs a file with a typo halfway and then fails, while TypeScript names the mistake before a single line runs. Install TypeScript into TaskKit with npm, check a file with npx tsc --noEmit, run it with node, and learn why tsc alone is not found.
- Type aliases (
type)Give a type a name with type and write the name wherever the type goes: on boxes, lists, parameters and results. See that the check opens the name, that messages say Task instead of the whole outline, and that an alias is only a name, so Minutes and TaskId are both number. TaskKit describes a task once, as Task. - Type errors vs runtime errors: why types vanish when the code runsSee the two kinds of error at their two moments: TypeScript’s while you type, Node’s while the program runs. Watch Node run a file TypeScript refused, with every type stripped out, and find the values no check can see, so you check them in code yourself.
typeorinterface: a simple rule for choosingChoose between type and interface with one rule: an object’s outline is an interface, everything else is a type. See that interface names only outlines, that two interfaces with one name merge while two type aliases are a Duplicate identifier, and switch TaskKit’s Task to an interface.- Types for packages:
@typesand thetypessettingInstall pluralize, a package that brings no description, and meet the check’s TS7016. Learn what a .d.ts description is, give TypeScript one from @types, tell from the TS and DT icons on npmjs.com whether a package needs it, and see why the check says --types node but never --types pluralize. - Union typesGive a value that comes in more than one kind a type of its own with |, like a fridge sheet of minutes where one day says “sick”. See why TypeScript allows a line on a union only when every member allows it, read which member an error names, and put the parentheses of (string | number)[] in the right place.
void: functions that return nothingWrite functions that do a job and give nothing back: the return type void, the undefined their call leaves behind, leaving early with return;, and actions handed to forEach.- What a program is and how a computer runs itWhat a program is, what the processor and memory do with it, and how your code travels from text through a TypeScript check to a running result. You run your first lines of TypeScript in the browser, see why the order of lines matters, and fix the two mistakes every beginner meets first.
- What asynchronous code is and why it existsLearn why some steps are waits and how a program can wait without standing still: synchronous code runs line by line, asynchronous code starts a wait and goes on. Use setTimeout to run a callback later, see why three timers take 3 seconds rather than 6, and why a value a callback sets must be used inside it.
- What
<T>means:Array<T>andMap<K, V>Learn to read types with angle brackets: one description with an empty slot serves every type, Array<T> fills one slot and Map<K, V> two, in order. See why an empty new Map() checks nothing, and move TaskKit’s tasks into a Map<string, Task> that catches a repeated title by itself. - When to use classes, and when functions and objects are enoughLearn when a class is worth it: a function for an answer worked out from its arguments, a plain object for data you read and save, and a class for data kept between calls under rules. Then see why TaskKit’s tasks stay plain objects.
- Where to find answers: docs, MDN, and AI assistants used wiselyKnow which of MDN, the TypeScript docs and the Node.js docs answers which question, read a reference page from title to compatibility table, and turn an error into a search. Ask an AI assistant with the whole picture, and check every answer with tsc, a run and the docs before you keep it. Closes Module 1 with its cheat sheet.
- Where to throw and where to catch: friendly errors for bad commandsRefuse a bad command where it is read, catch the refusal once where the program talks to the person, and write error messages that say what to type instead. Give TaskKit one friendly line for every command it does not know, and see why a catch that has to make up an answer is in the wrong place.
- Why an API response type doesn't guarantee what the data really looks likeSee why a type you write on a web API’s answer can be wrong while the check stays clean, what a broken promise looks like, a TypeError far from its cause or a believable wrong value, and check the answer as unknown with typeof, in and Array.isArray, with its own message for each missing part.
- Why libraries exist, and how to choose one: popularity, maintenance, built-in types or
@typesSee what a library gives your program and what it costs, look inside a package to find its code and its description, and ask four questions before you install one: does it do the job, how many use it, is anyone looking after it, and where are its types. - Working with strings: common methodsCall a string’s methods and read its length. Tidy text with trim, toUpperCase and toLowerCase, and keep the new string each one gives back, because the old one never changes. Chain methods, ask questions with includes, startsWith and endsWith, count positions from 0 with indexOf and slice, read TS2551, and make TaskKit tidy its task names.
- Your first error message: how to read it without panicRead any message from TypeScript or Node with five questions: who wrote it, where, what is wrong, any guess, which characters. Find the line and column, skip the stack trace and files that are not yours, and fix a missing quote's three errors by fixing the first one.
- Your first generic functionWrite your first generic function: give a function its own slot with <T>, let each call fill it from its arguments, and see why T keeps the type where any loses it. TaskKit gets findBy, a helper that searches any Map by a rule, tested on a Map of tasks and a Map of numbers.
- Your first input: command-line arguments with
process.argvGive a program its input on the line that starts it. See how the terminal splits the line, what Node puts in process.argv, and read each word by its index from 0. Keep words together with quotes, teach TypeScript about Node with @types/node, turn typed digits into a number, read TS2363, and make TaskKit read a command and a task. - Your setup: VS Code, Node.js, and basic terminal commandsInstall VS Code and Node.js, learn the handful of terminal commands that move you between folders, make the TaskKit project folder, and check that Node runs.
TypeScript from Zero · Bonus
- A package for npm: build TaskKit, describe it and try itBuild TaskKit into JavaScript with a second tsconfig, say in package.json what the package is and what it holds, and install the tarball the way someone else will, before the next lesson publishes it.
- Automation and serverless functionsLet your computer's clock run TaskKit's backup every night with cron or Task Scheduler, and write a serverless function that answers a phone with today's tasks, checked against Cloudflare's types before every deploy.
- Bundlers and dev servers (Vite)Put TaskKit's React page on your computer with Vite: work on it with the dev server, which converts each file as the browser asks and updates the page on save, build it into a few files with TypeScript's check in front, and see why a wrong prop the dev server lets through stops the build.
- Choosing a path: what to learn next for frontend, backend, or toolingPut everything Bonus A showed on one map of where TypeScript runs, tell frontend, backend and tooling apart by who uses what you build, choose one by trying an evening of each on TaskKit, and leave with what to learn next on your path.
- CI: running your checks on every pull request (GitHub Actions)Add a GitHub Actions workflow that runs TaskKit's type check, linter, formatter and tests on a fresh machine for every pull request, read which step failed and why, find the file a commit left out, and make GitHub refuse to merge until the check passes.
- Full-stack: sharing types between client and serverThe page and the server each passed their checks and the page still broke. Give both sides one Task type in a shared file, see a rename fail the check on both sides, check at the page's edge what an old server really sends, and meet the tools larger projects use for the same job.
- Git and GitHub: saving and sharing your workRead TaskKit's history, take back a change before or after it is pushed, and send a new feature through a branch you check with TypeScript and a pull request your friend reviews before it reaches main.
- In the browser: DOM types, the
libsetting, and whyquerySelectorcan returnnullTaskKit moves into a browser tab. Learn what the DOM is, how the lib setting tells TypeScript where code runs, why querySelector returns Element | null, and how to turn it into the element you need, with the page running right under the code. - Linters and formatters: Biome in TaskKitAdd Biome to TaskKit as its linter and formatter, find a forgotten await that npm run check lets through, and lay every file out one way so a pull request shows only the real change.
- Mobile and desktop appsTaskKit wants to be an app on a phone and a window on a desktop. See the two ways TypeScript leaves the browser, read a React Native screen and the typed bridge between an Electron app's two programs, and keep the channel names between them checked.
- On the server: Node.js, Deno, and Bun; a typed request handlerTaskKit's tasks vanish with a closed tab. Learn what a server, a port and a runtime are, write a typed request handler from a Request to a Response and run it on the page, check the body that comes in, and see how Node.js, Deno and Bun serve it.
- Publishing a package to npmPublish TaskKit to the npm registry under your scope, so one command installs it anywhere, and release fixes with npm version and semantic versioning.
- Scripts and command-line toolsTaskKit gets a backup script and a command you can type in any folder. Learn how a script reports success with its exit code, chain scripts with &&, check scripts before they run, and make TaskKit a command with bin and npm link.
typescript-eslintand Prettier: the tools other projects useTell from a project's files which linter and formatter it uses, run Prettier and ESLint with typescript-eslint, and get typescript-eslint past npm's ERESOLVE on TypeScript 7 with an alias.- UI frameworks: what they are and why they exist. React as an example (typed props and state in a few lines), with Vue, Angular, and Svelte mentionedTaskKit's page, kept right by hand, forgets its count. See why UI frameworks draw a page from its data, then write it in React with typed props and typed state, running on the page, and read the same component in Vue, Angular and Svelte.