Why consistency is one of the top indicators of good code
Software engineering is a lot easier in consistent systems.
Consistency is arguably my favorite principle in software engineering.
Far outweighing any other principle as an indicator of maintainability, I’ve experienced that systems built in a consistent manner are more maintainable than systems built inconsistently.
Defining consistency
Consistency is defined as: sameness, conformity, uniformity.
Unwavering consistency within a system leads to code where you can make more assumptions and predictions about its behavior and implementation that end up being accurate. On larger, older systems where you can’t fit the codebase in your head, these guesses are critical tools developers use to feel their way around the system.
You increase the number and frequency of correct assumptions by making your code consistent, and these correct assumptions (and verifications) lead to the many actionable steps you take during development.
The code ends up becoming reliable, avoiding surprises.
Ultimately, the thinking around a system that is consistent becomes a matter of intuition instead of pre-knowledge, leading to much more rapid…