Re: boolean affectation shortcut


#1

fr 13:

You can’ t because only methods can end with ?

i think he is asking, why not? of course, we know it is not currently
possible, but variable names with “?” may enhance readability.

consider,

x? = method_that_determines_some_status

if x?

end

by just looking at the name, we are pretty sure that x? is a boolean
(just like is_xx? methods return bools).

wc is better than,

if x

end

whether x is a variable or method…

it’s just an added character where one may happily use or not. But maybe
i am missing something deeper…

kind regards -botp