Skip to main content

Sign in to CleanKata

Track your progress, earn XP, and unlock every lesson.

By signing in you agree to our Terms of Use and Privacy Policy.

Clean Code60 XP6 min

Coherence & Clarity

Apply the same pattern everywhere, avoid conceptual clutter, and never couple unrelated concerns.

Consistency

G11: If you do something one way, do it that way everywhere. If you call a function fetchUser in one place, don't call a similar function loadUser somewhere else. The difference will confuse every reader into thinking the difference is intentional. When there is no difference, there should be no different name.

Conceptual Clutter & Artificial Coupling

G12: Clutter is code that doesn't earn its place. Default constructors with no implementation, variables never used, comments that say nothing — all add noise and zero value. G17: Artificial coupling is when unrelated things share a location for the developer's convenience. Enums defined in a class that doesn't use them, utility functions placed wherever the developer happened to be — these force readers to hunt for things in illogical places. Every piece of code should live where a reader would naturally look for it.

Code Challenge

Standardize the method naming convention across the service class.

💡Key takeaway

Coherence is a promise to every future reader: when you see a pattern, it means the same thing everywhere.

🔧 Some exercises may still have errors. If something seems wrong, use the Feedback button (bottom-right of the page) to report it — it helps us fix it fast.

Hint: G11: Pick one naming convention and apply it everywhere. G17: Don't force unrelated things to share a location.

✗ Your version