|
|
|
|
|
by efaref
3636 days ago
|
|
C/C++ also have & and | in the wrong place, mostly thanks to their heritage as being overloaded for && and ||). I've personally seen several (flags & MASK != VALUE) bugs make it to the field. Sometimes it's worked for ages as the 0th bit was part of what was being tested. Whilst adding more brackets can be useful to explain things, there comes a point when you have too much parenthesis. You have to rely at least a little on operator precedence, so you really do need to learn it. |
|