Naming Conventions: What to name a boolean variable?

Berek Bryan picture Berek Bryan · Aug 4, 2009 · Viewed 104.3k times · Source

I need a good variable name for a boolean value that returns false when an object is the last in a list.

The only decent name I can come up with is 'inFront', but I don't think that is descriptive enough.

Another choose would be 'isNotLast'. This is not good practice though (Code Complete, page 269, Use positive boolean variable names).

I am aware that I could change the variable definition. So true is returned when an object is the last and call the variable 'isLast', however, it would make this task easier if I had the first explanation.

Answer

Bela picture Bela · Aug 4, 2009
isBeforeTheLastItem

isInFrontOfTheLastItem

isTowardsTheFrontOfTheList

Maybe too wordy but they may help give you ideas.