Java boolean getters "is" vs "are" Java boolean getters "is" vs "are" java java

Java boolean getters "is" vs "are"


How about having decent enough english and following Java standard:

isEveryStoreOpen() or isEachCatCute()

When in doubt of the right word I always like to hit up the thesaurus.


I can't remember which book this was from, but the essence is that code will be read many more times than it's written. Write for readability.


The convention is to prefix the getter-method with "is" not the variale itself.

e.g.

private boolean enabled;public boolean isEnabled() {    return enabled;}

and

private boolean storesOpen;public boolean isStoresOpen() {    return storesOpen;}

isStoresOpen() doesn't make sense in English.

It might not make sense grammatically, but it follows the convention and looks readable enough.