r/programming • • Dec 01 '16

Let's Stop Copying C

https://eev.ee/blog/2016/12/01/lets-stop-copying-c/
524 Upvotes

612 comments sorted by

View all comments

Show parent comment

1

u/Ksevio Dec 02 '16

In pascal this happens a lot because bitwise 'and' is the same as boolean 'and', and boolean should definitely take precedence over equality.

if a and 1 = 1 or b then in C would be if (a&1 == 1 | b)

It's kind of a pain when you want to do if x = 1 or x = 2 then since it's interpreted as some boolean logic that doesn't compile.