Software Design/Always use the same way to do a thing
Checklist questions:
- When there is more than one way to do a certain task, is the same way used throughout the codebase?
Examples
editCollections.emptyList()
vs. ImmutableList.of()
in Java.
Why
edit- Consistency
- Easier to refactor
- Performance: less code is used => less code cache misses
Related
editSources
edit- Zen of Python