Naming of predicate methods

A predicate method is tipically one that should return a boolean value (true or false). These methods are useful in a lot of scenarios, like when you have an class with a boolean attribute.

Naming these kind of methods depends on the language you are using, but here are my top priorities.

Question mark

If you are using Ruby you can name it with a question mark at the end, which makes the code really readable. Something like this:

def is_alive?
  @alive
end

Question style

In some languages you can’t use a question mark in the name of a method, so I usually name it like this:

public Boolean isAlive {
  return alive;
}

Simple Getter

The worst name here, in my opinion, is having a get, like any other getter. I think it’s the worst case because when you are reading the code is more confortable to have something like:

zombie.isAlive?

Instead of:

zombie.getAlive

Conclusion

Of course naming is something so opinable that it would be silly to think more about this problem. I think with experience you can see the pros and cons of every option, I could even change my mind in some months about this :)