Basic Hygiene
- Leave the place cleaner than you got it.
Naming Convention
- Do one thing in a function. Name should reflect the action. Function name is a verb.
- Declare literals
([a-z]+, [0-9]+)
as constants.
Functions
- The function should not exceed twenty lines.
- Each
if
,else
,while
statement can become a function. - The function can have one or two levels of indentation.
- A function must do only one thing. The one thing is discovered when function can’t be reduced further. The reduced name is similar to the function’s current name.
This post is updated until the book “Clean Code” completes!
Reference
Written with StackEdit.