DEV Community

Onyedikachi Emmanuel Nnadi
Onyedikachi Emmanuel Nnadi

Posted on

Top 10 Clean Code Rules

An Image showing Clean Code book by Robert C Martin on top of a laptop keyboard.
According to “Clean code” book by Uncle Bob, he defined some guidances and rules that developers should follow. This is more imperative for the less experienced developers. With more experience, comes the possibility of breaking some rules or reinventing them with justifications.

No code comments.
A good code needs no comment. The variables, methods, and any other component of the code such as attributes should use easily identifiable and descriptive names.

“Code comments are smell, remove them.”

Dead comments or code should be deleted.
Any unused piece of code or comments should be deleted. The best place to find them is in the version control systems.

Incorrect behaviour at boundaries.
Boundaries should always be unit tested. No behaviour should be assumed.

Positive conditionals.
Positive conditionals are easier to read than negative conditionals.
click the link to read the full thread
https://x.com/_iamdikachi

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs