Hacker News new | ask | show | jobs
by kostya-kow 4772 days ago
I don't think it really improves readability. All the programmers are familiar with && and ||, and using something else will just confuse people.

Also, it's not really that hard to #define it yourself, instead of using includes.

1 comments

I definitely wouldn't use them because they are unfamiliar. However, in my head I pronounce "&&" as "and" and "&" as "bitand", so using and/bitand over &&/& would reduce a depressingly not-uncommon typo for me. However, on balance, not worth it to me.

Note that in C++ they are keywords which is superior to macros.

How are they superior?
For one, a macro "and" would prevent you from using "and" as the name of a struct field, while a keyword will not. Error reporting will be better too. The differences don't seem all that big though.