Skip to content
quotesby

About this quote

What does it mean?
When unsure, add parentheses; it prevents errors and helps editors like vi.
In plain terms
Parenthesize to avoid mistakes.
What can you take from it?
Use parentheses to clarify precedence.

Where it applies

  • writing complex expressions
  • debugging

Putting it to work

  • add parentheses early
  • test in vi

Questions to consider

  • When does extra parentheses hurt more than help?

Another view

Over‑parenthesizing can clutter code.

More from Larry Wall

  1. *** The previous line contains the naughty word '$&'. if /(ibm|apple|awk)/; # :-)

    Permalink to quote #275
  2. But I'm not here to talk about postmodernism. I tried to do that last spring, and afterwards I was thoroughly deconstructed by the deconstructionists for attem…

    Permalink to quote #277
  3. The autodecrement is not magical.

    Permalink to quote #274

Related quotes

  1. And don't tell me there isn't one bit of difference between null and space, because that's exactly how much difference there is. :-)

    Larry WallLarry Wall quote #2
  2. > (It's sorta like sed, but not. It's sorta like awk, but not. etc.) Guilty as charged. Perl is happily ugly, and happily derivative.

    Larry WallLarry Wall quote #51
  3. We toast the Lisp programmer who pens his thoughts within nests of parentheses.

    Alan PerlisAlan Perlis quote #2