Don’t Mansplain Your Code

When getting one’s code reviewed, if a reviewer asks what the code is doing or why the code does not follow the common conventions, don’t answer them The problem is not that they don’t understand; the problem is that your code is not clear

Change the code so it is clearer: improve the nomenclature; break operations into separate functions; or, if absolutely necessary, add a comment. You might find bugs, missing cases, or other improvements in clarifying the code. In any case, your code must be able to speak for itself unless you add your personal phone number

Don’t write so that you can be understood; write so that you cannot be misunderstood – William Taft

Comment only what the code cannot say – Kevlin Henney

This principle includes comments on a Wiki (e.g. Confluence). Don’t reply to the comment; edit the entry so it answers the question

First appeared on LinkedIn 10 Jan 2020

Second appeared under Don’t Lower the River; Fix the Bridge


Now read this

Python Decorators (and Digressions)

Decorators are a bit of meta-programming that allows one to add behaviour to functions and classes. The original function or class is wrapped in another function or class, and its name is pointed to that wrapper. Any use of that name... Continue →