this post was submitted on 03 Dec 2023
3 points (100.0% liked)

196

16551 readers
2069 users here now

Be sure to follow the rule before you head out.

Rule: You must post before you leave.

^other^ ^rules^

founded 1 year ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] mindbleach@sh.itjust.works 2 points 11 months ago (1 children)

Different compilers have robbed me of all trust in order-of-operations. If there's any possibility of ambiguity - it's going in parentheses. If something's fucky and I can't tell where, well, better parenthesize my equations, just in case.

[–] linuxdweeb@lemm.ee 0 points 11 months ago (1 children)

This is best practice since there is no standard order of operations across languages. It's an easy place for bugs to sneak in, and it takes a non-insignificant amount of time to debug.

[–] SmartmanApps@programming.dev 1 points 8 months ago

there is no standard order of operations across languages

Yes there is. The rules of Maths are universal.

It’s an easy place for bugs to sneak in

But that's because of programmers not checking the rules of Maths first.