- Leave the place cleaner than you got it.
- Do one thing in a function. Name should reflect the action. Function name is a verb.
- Declare literals
([a-z]+, [0-9]+)as constants.
- The function should not exceed twenty lines.
whilestatement 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!
Written with StackEdit.