3 ms·
> One thing I think is tiny, but incredibly helpful in Ruby, and I don't understand why more languages don't have it - the ability to add "?" and "!" to operato
by tesseract 15y ago
> One thing I think is tiny, but incredibly helpful in Ruby, and I don't understand why more languages don't have it - the ability to add "?" and "!" to operators. That's an actually useful convention.
My primary languages are Ruby and C. After working in Ruby for a while and then switching back to C I often find myself naming predicates with a trailing _q. I don't have an equivalent for !, though.
- edanm 15y agoIn C/C++, I was usually in the habit of adding "Is" in front of predicates. "something.IsDone()", "something.IsOver()", etc.