Use the same vocabulary for the same type of variable


Bad:

getUserInfo();
getClientData();
getCustomerRecord();
getPersonDateOfBirth();

Good:

getUser();
getUserDateOfBirth();

Why

  • Using the same vocabulary creates clarity and understanding
  • Reduces confusion

Derivative work

This work is a derivative of "clean-code-javascript" by Ryan Mcdermott, originally licensed under MIT. The original version can be found here.