Get the nouns and verbs right. Great names capture what a component is or does and create a clear, intuitive model. They show you understand the domain. Take time to find good names where nouns and verbs fit together, making the whole greater than the sum of its parts.
Clear and consistent naming: Use descriptive and meaningful names for variables, functions, and files. Good naming clarifies code readability and each component's purpose. Stick to a consistent style, like snake_case, throughout the codebase.
Avoid abbreviations: Use full words in names unless the abbreviation is widely accepted and clear (e.g., ID, URL). Abbreviations can be confusing and make it harder for others, especially new contributors, to understand the code. Include units or qualifiers in names: Append units or qualifiers to variable names, placing them in descending order of significance (e.g., latency_ms_max instead of max_latency_ms). This approach clarifies meaning and avoids confusion. Related variables like latency_ms_min line up logically.
Document the 'why': Use comments to explain why decisions were made, not just what the code does. Knowing the intent helps others maintain and extend the code properly. Give context for complex algorithms, unusual approaches, or key constraints.
Use proper comment style: Write comments as complete sentences with correct punctuation and grammar. Clear, professional comments improve readability and show attention to detail. They help create a cleaner, more maintainable codebase.