Yoki

← Notes

#til #code

Names should describe what, not how

fetchUserFromCacheOrDb() tells me how it works and will be wrong the day the cache goes away. getUser() tells me what I get, and stays true. If the how matters to the caller, it usually belongs in a parameter, not the name.

↑↓select↵openescclose