Track 3 of 4 · 6 short steps
Writing Code That Lasts
Goal: Write code that other people, future you, and future AI sessions can understand, test and safely change.
Why this matters
AI can generate a 900-line file in seconds. The hard part is changing it next month without breaking three other things. Software engineering is the craft of keeping a codebase easy to change. It matters even more with AI, because AI tools work best on small, clearly organized, well-tested code.
The steps
Each step is a 2-minute read with a quick check at the end.
- Step 1
Version control with Git
- Step 2
Separation of concerns and layers
- Step 3
SOLID and design patterns, in plain English
- Step 4
Code smells and technical debt
- Step 5
Testing: unit, integration, end-to-end
- Step 6
Test-driven development (TDD)
Try it
Challenge: Spot the bug
Click the line with the bug.
The empty catch {} swallows the error, so a failed charge still gets marked paid. Handle or rethrow it.
AI mistakes to watch for
- One giant component or file that fetches data, holds business logic and renders UI.
- Copy-pasted logic in several places, so a bug fix only gets applied to one of them.
- Tests that only check the 'happy path', or tests the AI changed so they'd pass.
- Swallowing errors with an empty
catch {}so failures are silent. - Huge commits mixing five unrelated changes, impossible to review or revert.
- Dead code, unused dependencies and leftover
console.logs after many prompt iterations.
Tip: paste a file into your AI tool and ask, "Check this for each of these issues and explain any you find." Then verify what it says yourself.
Milestone checklist
Your ticks are saved in this browser only.
Reading & free resources
- The Pragmatic Programmer (Thomas & Hunt)Core book. Practical habits of good developers.
- Refactoring (Martin Fowler)Core book. The catalog of safe ways to improve existing code.
- Pro Git book (free)The official, complete guide to Git.
- Learn Git BranchingInteractive, visual Git practice in your browser.
- Refactoring.GuruFree illustrated guides to code smells and design patterns.
- VitestFast test runner for JavaScript/TypeScript projects.
- PlaywrightEnd-to-end browser testing.