Stage 5 · Lesson 9 of 10
Comments, docstrings and READMEs
Good code explains what it does through its names. explain why: a business rule, a workaround, or a decision that looks wrong but is not. A comment that repeats the code, such as "add one to i", is noise that goes out of date.
Docstrings and documentation comments describe what a public expects and returns, and editors show them as you type. A README is the front door of a project. It says what the project does and how to install and run it, gives an example, and says how to run the tests.
Test yours by following it on a fresh machine, or ask a friend to. The milestone and the next stage both need one.
A question to check yourself, an AI practice session and 1 cheat sheet entry come when you add the roadmap to your account. Add it
Resources for this stage
Start with· follow one of these
- CoursePaidGrokking SOLID Design Principles
Design Gurus · Beginner · $50 one-time
Five principles with code examples, including when applying them makes code worse
- GuideFreeRefactoring.Guru: Code Smells and Refactoring
Refactoring.Guru · Beginner
Free catalogue of code smells and the small refactorings that fix each one