Kent Beck’s Rules of Simple Design #2

Sean Coates
Aug 28, 2017 · 1 min read

The code must express the intent of the programmers.


Choose good names. Variable, method, and class names should be obvious and clear. Don’t be afraid to have long names. Don’t re-use names.

Keep methods small. A reader should be able to tell at a glance what a method is doing and how it is doing it. Under ten lines is ideal.

Use standard nomenclature. Don’t use words that aren’t appropriate to the domain. Don’t use metaphors or similes. Say what you mean.

Never be cryptic or clever. Avoid complex algorithms and obfuscated code. Programming is not an intelligence contest. The easier it is to understand, the better the code will be.

Use comments appropriately. Comments should explain why, not what. If you can’t tell what the code is doing, then the code is too complicated.

)
Sean Coates

Written by

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade