Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Sigh... I know of at least one coding standard that insists on not having bare Booleans in conditionals but instead code of this sort:

if (foo == true && bar == false) ...

and it's so prolix it drives me crazy (especially if combined with a naming convention for Booleans, so it's obvious from the name that the value in question is Boolean). I feel like I'm in an epistemology class. "If the truth-value of the proposition p is true...."

If ! is easy to overlook, what about other unary operators? Perhaps we should write (0 - x) instead of -x, (0xffff ^ x) instead of ~x, and x[0] instead of *x.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: