Programming foundations

Stage 5 · Lesson 9 of 10

Comments, docstrings and READMEs

Object-oriented design and clean code

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

Practise

  • Request mentoring on a solved exercise and ask specifically about naming and structure

Keep handy

  • Fast test runner for Node.js projects; the getting started page is all you need now

Also worth your time

Mark this stage as not done?