How to write maintainable code
summary
Argues concrete practices: prefer better names (use a ceteris or thesaurus to expand vocabulary), write functional tests such as Gherkin feature files, leave one-sentence file comments and a short README (README-driven, Minimum Viable Documentation), apply the rule of three before abstracting, and budget refactoring — year two ~10% of team time, add ~10% each year so by year five ~50% — with a maintenance cliff around ~100,000 lines of code.
AI-written summary · about
chapters (15)
- 0:00Intro
- 1:17Writing unmaintainable code
- 1:59Modern languages give you all the toy
- 3:01OOP and FP at the same time 2. Exceptionally expressive programming language 3. Rapid language development-major changes 4. Early-adopter culture s. Computer science vs mathematics vs enterprise dev a rich community but sometimes with conflicting so
- 6:40Clean code & tests to the rescue
- 7:131. Inconsistent code styles (OOP vs FP, Java vs Haskell) 2. Repetition 3. Too much abstraction (unnameable invented concepts) 4. Spaghetti code s. Lasagne architecture (too many layers) 6. Inadequate tests (low coverage, incomprehensible)
- 18:05Write clean code 4. Get better at naming
- 19:30Write explanatory functional tests
- 20:02How to write maintainable code
- 20:20Clean code and good unit tests are great, but they're not enough (this is the bad news)
- 23:49'Beware of DRY, the evil siren that tricks you into abstraction' Martin Thompson a.k.a. @mjpt777
- 30:26Take the Boy Scout Principle seriously (actually enforce it) Do code review on all changes Recognise code smells Refactor
- 34:03Explain the system's purpose What is the business reason? Why are we here? Describe the scope (What defines what the system does and doesn't do?) Summarise what it does (What does it actually do? What is it for?)
- 35:02Only complex systems require detailed documentation, e.g. Architecture diagram UML diagram Data dictionary Process model Business rules
- 36:56Celebrating 5 years of the art, craft, science and joy of software development
related talks
59mTechniques for writing high-quality code
25mBest Practices for Writing Clean and Maintainable Codes
39m7 Secrets of Maintainable Codebases
51mReasons and Ways to Improve Code Quality
39mInheriting code, and I don't mean classes
48mThree Principles To Bring Your Legacy Code Into the Future
40mGood Code: What, Why, and How to Get There
42mThe art of clean code
