this post was submitted on 03 Dec 2023
404 points (99.5% liked)

196

16098 readers
2124 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 113 points 8 months ago (21 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.

[–] [email protected] 9 points 8 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.

[–] [email protected] 2 points 5 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.

load more comments (19 replies)