Consistent code
The code is written in a uniform and conventional way. All the code looks similar and follows a regular pattern, even with multiple contributors at different times. Consistent code is formatted, conventional, and identifiable. For example, when code is formatted well, it is systematic and regular, which reduces differences between authors’ coding styles and makes code much easier to review by peers on pull requests.
- Formatted: The code presentation is well-organized, systematic, and regular. Non-semantic choices, such as spacing, indentation, and character placement, remain consistent throughout the codebase, maintaining uniformity across files and authors.
- Conventional: The code performs tasks with expected instructions. Faced with equally good options, the code adheres to a single choice across all instances, preferring language conventions. This includes using the appropriate programming interfaces and language features.
- Identifiable: The names follow a regular structure based on language conventions without arbitrary differences. The casing, word separators, suffixes and prefixes used in the identifiers have purpose, without arbitrary differences.