Name Your Booleans Like A True Or False Question
[!INFO]-
topic: ๐งน Clean Code
links: Names in your code should be meaningful
source: Clean Code | Udemy
tags: #permanent-noteย #published
Last Modified:
=dateformat(this.file.mtime, "MMM. dd, yyyy - HH:mm")
While your variable names should usually describe the value as clear as possible, your booleans should always be a question, which can be answered with yes or no. When in doubt, starting with is
is often a good way.
Same goes for functions that compute a boolean.
isLoggedIn
isValid