Hi, expert here, calculators have nothing to do with it. There’s an agreed upon “Order of Operations” that we teach to kids, and there’s a mutual agreement that it’s only approximately correct. Calculators have to pick an explicit parsing algorithm, humans don’t have to and so they don’t. I don’t look to a dictionary to tell me what I mean when I speak to another human.
There aren’t two different sets of rules. There’s the simple model that’s commonly understood and taught to kids, and there’s the real world where you have context and the dynamics of a conversation and years of experience with communication. One is well defined, the other isn’t.
Them asking me to solve the arithmetic problem is condescending, yes.
My response didn’t say “anyone who disagrees with the convention is stupid.” Here’s condescension for you: please don’t make your reading level my problem. What I said was, there’s an unambiguous way to parse the expression according to the commonly understood order of operations, but it is atypical to pay that much attention to the order of operations in practice. If you think that’s a value judgment, that’s on you-- I was very clear in my example about capitalization, “strictly adhering to the conventional order of operations” is something reasonable people often just don’t care about.
My opinion hasn’t changed. The standard order of operations is as well defined as a notational convention can be. It’s not necessarily followed strictly in practice, but it’s easier to view such examples as normal deviation from the rules instead of an implicit disagreement about the rules themselves. For example, I know how to “properly” capitalize my sentences too, and I intentionally do it “wrong” all the time. To an outsider claiming my capitalization is incorrect, I don’t say “I am using a different standard,” I just say “Yes, I know, I don’t care.” This is simpler because it accepts the common knowledge of the “normal” rules and communicates a specific intent to deviate. The alternative is to try to invent a new set of ad hoc rules that justify my side, and explain why these rules are equally valid to the ones we both know and understand.
It’s not ambiguous, it’s just that correctly parsing the expression requires more precise application of the order of operations than is typical. It’s unclear, sure. Implicit multiplication having higher precedence is intuitive, sure, but not part of the standard as-written order of operations.
People ITT hating on null coalescing operators need to touch grass. Null coalescing and null conditional (string?.Trim()) are immensely useful and quite readable. One only has to be remotely conscious of edge cases where they can impair readability, which is true of every syntax feature