re: How Do You Name Your Boolean Variables? VIEW POST

VIEW FULL DISCUSSION
 

I prefer the first example in both cases. Specificity depends on the context. Does the function care about the "store" or not? Could Godzilla exist somewhere else, heaven forbid?

My go-to is to default to writing booleans in a way that makes them read more sentence-like in context. For example:

if ( godzillaExists && mothraExists ) {
  doBattle(godzilla, mothra) 
}
code of conduct - report abuse