<div class="gmail_quote">On Fri, Aug 12, 2011 at 1:09 PM, Chris Angelico <span dir="ltr"><<a href="mailto:rosuav@gmail.com">rosuav@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div class="im">On Fri, Aug 12, 2011 at 6:57 PM, rantingrick <<a href="mailto:rantingrick@gmail.com">rantingrick@gmail.com</a>> wrote:<br>
> I'm glad you brought this up! How about this instead:<br>
><br>
>    a = x + y * z<br>
><br>
> ...where the calculation is NOT subject to operator precedence? I<br>
> always hated using parenthesis in mathematical calculations. All math<br>
> should resolve in a linear fashion. 3+3*2 should always be 12 and NOT<br>
> 9!<br>
<br>
</div>Why is left-to-right inherently more logical than<br>
multiplication-before-addition? Why is it more logical than<br>
right-to-left? And why is changing people's expectations more logical<br>
than fulfilling them? Python uses the + and - symbols to mean addition<br>
and subtraction for good reason. Let's not alienate the mathematical<br>
mind by violating this rule. It would be far safer to go the other way<br>
and demand parentheses on everything.<br></blockquote><div><br></div><div>Left-to-right is more logical because that is the choice made by the English language (which I will note, we are using right now). Also, ignoring operator precedence, left-to-right is the way math equations evaluate. See 4 / 2 * 3 - you get 6, not (2/3) and not (3/2).</div>

<div><br></div><div>Now, I would not suggest changing the multiplication before addition rule, for the very reason you mention: in many cases, the established rule is expected, but that does not mean it is more logical.</div>

<div><br></div><div>Chris</div></div>