Re:What does the ??!??! operator do in C?
by dahfizz on Thursday October 06, 2022 @12:54PM
(#33110797)
Can you give an example of syntactic sugar in a modern language that makes order of operations a non-issue?
[ Parent
| on HN ]
Parentheses
Re:What does the ??!??! operator do in C?
by dahfizz on Thursday October 06, 2022 @05:55PM
(#33114597)
Yeah, that's why I said
> Just use parentheses
Not sure what that has to do with memory usage..?
Just to clarify, I'm not the original person you replied to, and we all agree about using parentheses.
mrguyorama just implied that the only reason you would check the operator precedence chart would be to shave a few bytes off the size of your source code, which has not been a reasonable reason to do anything for many decades, and yet C programmers seem to like to do it anyway.
These aren't syntactic sugar, but formatters. I rather like Ormolu for Haskell and elm-format for Elm. I occasionally type a bunch of parenthesis so that I'll for sure have the right order of operations. Then the format on save removes the redundant ones. It's delightful. The typecheckers and tendency to wrap primitives in a semantically significant constructor help with that.