Comments (1)
Thanks for the suggestion, @jltwheeler.
I'd suggest going with a positive isDog
and negating it when necessary.
const isDog = (dog) => dog.sound() === 'bark'
if (isDog(pet)) {
// handle a situation when pet is a dog
}
if (!isDog(pet)) {
// handle a situation when pet isn't a dog
}
I rarely encounter a need for negative boolean variables, so please feel free to reference any examples you see fit.
from naming-cheatsheet.
Related Issues (20)
- Nam
- Add recommendation on how to handle unsafe async / remote fetch functions HOT 4
- isRoot or hasParent? HOT 2
- Incorrect order of arguments HOT 1
- React prop: disabled Vs. isDisabled HOT 4
- Role-based names vs. Information Repetition HOT 1
- JavaScript getter/setters (S|Get keyword) HOT 5
- Use of singular/plurals for compound terms HOT 2
- add translation version link in readme.md HOT 4
- verb suggestions HOT 2
- Counter-example to avoiding `a` as a variable name HOT 1
- Why can't I jump to the anchor link in the Readme document? HOT 2
- Suggestion: difference between verb `remove` and `delete` HOT 2
- Questions about naming functions? HOT 1
- Suggestion: Change [Reflect the expected result] to [Reflect the positive result]
- What about abbreviation / Acronyms? HOT 1
- State-of-being verbs HOT 1
- Add Create Action
- [suggestion] Add type naming conventions & recommendations
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from naming-cheatsheet.