Hacker News new | ask | show | jobs
by wmu 1889 days ago
I often use "not", "and", "or" to clearly express logical conditions. Bit operations look better as cryptic symbols "&", "|" and "~". :)
3 comments

A valid opinion for language design, but when writing real C++ code, I'd stick to the usual way of doing things.

English language keywords aren't always great for readability in my opinion. Ada's and then / or else syntax, for instance. They're the short-circuit syntax, whereas and and or give eager evaluation. [0] You can't determine that just from the syntax though, so it ends up being no less cryptic than using strange symbols the way C++ (typically) does.

[0] https://en.wikibooks.org/wiki/Ada_Programming/Operators#Shor...

I do this too, as I find it a bit more readable. Also, I find it handy to reserve '&&' exclusively for rvalue references.
Same. `a and b or c` reads nicer than `a && b || c` to me.

And I find its harder to typo and misread it:

`a && b || c` vs `a & b | c`

`a and b or c` vs `a & b | c`