I got some people really angry at me when I suggested writing some math expression with parenthesis so it would be clearer. I think someone told me that order of operations is like a natural law and not a convention, and thus everyone should know it or be able to figure it out.
Using parenthesis can really help if you want to simplify a term or need to rewrite something. I do that all the time because a lot of times you then can just cross stuff out fast on equations or get a common term that just has some factor instead of having a convolutet equation.
I got really angry because the prettier code formatter insists on removing parentheses, making things less clear. Because it’s an “opinionated” formatter you can’t tell it not to do that without using ugly hacks.
Sure, logically there are times when you don’t need them. But, often it helps to explain what’s happening in the code when you can use parentheses to group certain things. It helps in particular when you want to use “&&” and “||” to say “do X only if Y fails”.
I sometimes like to add unnecessary parentheses or brackets to section things off and improve legibility, but I don’t do any math stuff collaboratively, so I have no idea whether others would find that disruptive or helpful.
I got some people really angry at me when I suggested writing some math expression with parenthesis so it would be clearer. I think someone told me that order of operations is like a natural law and not a convention, and thus everyone should know it or be able to figure it out.
Using parenthesis can really help if you want to simplify a term or need to rewrite something. I do that all the time because a lot of times you then can just cross stuff out fast on equations or get a common term that just has some factor instead of having a convolutet equation.
I got really angry because the prettier code formatter insists on removing parentheses, making things less clear. Because it’s an “opinionated” formatter you can’t tell it not to do that without using ugly hacks.
Sure, logically there are times when you don’t need them. But, often it helps to explain what’s happening in the code when you can use parentheses to group certain things. It helps in particular when you want to use “&&” and “||” to say “do X only if Y fails”.
I think you can do
// prettier-ignore, because I remember facing that exact situation.https://prettier.io/docs/ignore/
I sometimes like to add unnecessary parentheses or brackets to section things off and improve legibility, but I don’t do any math stuff collaboratively, so I have no idea whether others would find that disruptive or helpful.
I do this, sometimes it helps reveal a natural pattern when some parts of earlier terms have “disappeared” to simplification
I mean, there are very few ambiguous cases when you know how the order of operations works.
deleted by creator