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

ruby - When to use an ORM (Sequel, Datamapper, AR, etc.) vs. pure SQL for querying -

php - PHPDoc: @return void necessary? -

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