self-documenting code

noun
UK /ˌself ˈdɒkjʊmentɪŋ kəʊd/
US /ˌself ˈdɑːkjumentɪŋ koʊd/

Code that is so clear that you can understand it without extra notes.

Because the variable names were so descriptive, the self-documenting code needed no comments.


OTHER MEANINGS

2. Code written so its structure explains its purpose without separate documentation.

The team preferred self-documenting code over long design documents.

3. A style where function and variable names describe exactly what they do.

Using calculateTotalPrice instead of calc is a simple step toward self-documenting code.

4. Code that reduces the need for inline comments because the logic is obvious.

Reviewers praised the self-documenting code for making the payment flow easy to follow.