Why consistency is one of the top indicators of good code
- Consistency can be defined as both conformity and uniformity.
- Consistency in code allows you to make accurate assumptions and predictions about its behaviour and implementation.
- Small continuous improvements in the approach of doing things can introduce a great inconsistency in the overall code over time. Try to ensure complete adoption of the new approach, phasing out the old one entirely.
- Where both approaches must remain, at least preserve consistency within verticals or modules.
- Name things consistently (so that similar objects sound similar and dissimilar ones sound different) and let the name reveal context, behavior, and intent.
Full post here, 6 mins read