What is the favorable naming convention for methods or properties returning a boolean value in Ruby? -


i've seen of these:

  • is_valid

  • is_valid?

  • valid?

is there preferred one?

edit: more conditionals:

  • has_comment has_comment? comment?

  • was_full was_full? full?

please add more descriptive examples.

i think convention add '?' @ end of method instead of 'is'

  • valid?

Comments

Popular posts from this blog

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

c++ - Convert big endian to little endian when reading from a binary file -

openssl - Load PKCS#8 binary key into Ruby -