In article <mailman.6143.1391091519.18130.python-l...@python.org>,
 Chris Angelico <ros...@gmail.com> wrote:

> On Fri, Jan 31, 2014 at 1:08 AM, Roy Smith <r...@panix.com> wrote:
> > Better than that, do what I do.
> >
> > 1) Assume that you don't have the full operator precedence table
> > memorized and just parenthesize everything.
> 
> Or:
> 
> 1a) Assume that you don't have the full operator precedence table
> memorized and just look it up, for whichever language you're working
> with today. :)

It's faster to just stick in some extra parens.  Not to mention that it 
makes the code more clear for everybody reading it later.

Operator precedence is a tricky thing.  In part, because it's somewhat 
arbitrary, and in part because it changes from language to language.  
Using "extra" parens to make my meaning clear (to both the compiler and 
other humans who read the code in the future) is a simple technique 
which works in all languages.
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to