inside front cover

 

Clean Code Checklist

Use this short checklist when encountering code that you are unfamiliar with or while writing new code.

General

My code reads like a narrative. I write code for humans, not machines.

I document my code only when necessary. My code should speak for itself.

I provide clear instructions on how to build and release my codebase. Where appropriate, I provide working build scripts/makefiles or CI/CD setup instructions.

I use native functionalities instead of implementing my own libraries, unless for a very good reason.

My code is consistent in its design patterns, documentation, and naming conventions. I do not change things mid-development and go against established patterns.

I have added logging to my application, so I or other developers can debug when things go awry.

Classes

My class has the strictest access modifier possible.

My class is named accurately.

My class performs operations on only one specific object and, therefore, adheres to the single-responsibility principle.

My class lives in the right folder within my project.

If I struggle with implementing my class, I take a step back and come up with a brief description of the class and its intended functionality. This refocus can help write cleaner code. If my class should do multiple things, split it up.

Methods

My method has the strictest access modifier possible.

My method is named accurately and correctly describes the logic within (leaving nothing out).