# Re: boolean affectation shortcut

**URL:** <https://www.ruby-forum.com/t/re-boolean-affectation-shortcut/94764>\
**Category:** Ruby\
**Created:** [May 13, 2006, 12:09pm UTC](https://www.ruby-forum.com/t/re-boolean-affectation-shortcut/94764 "2006-05-13T12:09:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![PeSSSSaS\_Botp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ecd19e/32.png) [@PeSSSSaS\_Botp](https://www.ruby-forum.com/u/PeSSSSaS_Botp)\
**Post date:** [May 13, 2006, 12:09pm UTC](https://www.ruby-forum.com/t/re-boolean-affectation-shortcut/94764/1 "2006-05-13T12:09:17Z")

</div>

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
