Use Pronounceable Names
Learn the importance of using pronounceable names in your code. Discover how it improves communication and enhances code readability and maintainability.
Usage
π Guideline
Use Pronounceable Names: Choose names that are easy to pronounce to facilitate verbal communication within your team.
Choosing good names takes time but it saves even more time. Names should be easy to pronounce to be able to communicate with your teammates verbally.
π οΈ How to Apply
- Choose names that can be effortlessly pronounced and understood by team members. π₯
- Avoid using ambiguous or cryptic names that may lead to confusion or miscommunication. π€·ββοΈ
- Prioritize readability and clarity when selecting names, aiming for simplicity and ease of verbal communication. π’
Pros and Cons
π Pros
- Improved Communication: Pronounceable names facilitate effective verbal communication among team members, enhancing collaboration and understanding. π¬
- Clarity and Readability: Names that are easy to pronounce contribute to the readability and comprehensibility of the code, making it easier to maintain and understand. β¨
π Cons
- Naming Constraints: The requirement for pronounceable names may sometimes limit the use of more concise or creative naming choices. π«
- Increased Naming Effort: Choosing pronounceable names may require additional time and effort compared to using arbitrary or cryptic names. π
Examples
β Bad
const yyyymmdstr = moment().format("YYYY/MM/DD")
β Good
const currentDate = moment().format("YYYY/MM/DD")
References
π Related principles
- Meaningful Naming: Use names that accurately describe the purpose and functionality of variables, functions, and classes. π
- Consistent Naming: Establish and follow consistent naming conventions throughout the codebase to enhance readability and maintainability. π
- Self-Explanatory Names: Choose names that are self-explanatory and reduce the need for additional comments or documentation. π
- Avoid Abbreviations: Use full words instead of abbreviations to improve code clarity and understanding. π«