Have you ever spent an hour expecting 2+2*2 to be 8 before you figured out that you're missing some parenthesis?

Turns out that almost two decades of programming experience did not prepare me for an equivalent problem with operator precedence in C. Never trust a human brain ๐Ÿ˜œ

ยท Tootle ยท 3 ยท 0 ยท 9

@dos I always write out the parentheses as I expect them to be and then let linters remove them if unnecessary. Been doing that for 12 years now ๐Ÿ˜‚

@dos Is the "Do the multiplication and division" type rule not universal?

Sign in to participate in the conversation
Librem Social

Librem Social is an opt-in public network. Messages are shared under Creative Commons BY-SA 4.0 license terms. Policy.

Stay safe. Please abide by our code of conduct.

(Source code)

image/svg+xml Librem Chat image/svg+xml