in reply to Re: To parens or not parens in chained method calls
in thread To parens or not parens in chained method calls

Completely agree that consistency might be most important and that every dev is free to choose her own style (unless a house style is enforced, etc).

I argue that omitting parens, and breaking across lines into semantic chunks, does make the code more clear to a human reader; less content is less cognitive load. Athanasius's examples of the same operation in two styles shows this; where the single line idiom is, to a Perl-centric dev, much easier to read. There is less you have to load into your brain and fewer chances to read something wrong. I'm aware the longer version will likely be easier to follow for a non-Perl hacker. Just as a book written with 3rd grade vocabulary will be easier to the average reader or an ESL student. I gravitate away from the LCD because it ultimately saves time and raises my own game. It's more fun too. When I see an idiom in code that I don't know, I am generally more excited to learn it than I am irritated I don't understand it immediately.

  • Comment on Re^2: To parens or not parens in chained method calls

Replies are listed 'Best First'.
Re^3: To parens or not parens in chained method calls
by Anonymous Monk on Feb 16, 2017 at 18:46 UTC
    yet you don't write unit tests ... go figure

      I probably write too many unit tests. You have me confused with someone else; which is pretty hard to do since I frequently answer testing related questions here.

        That's one thing we definitely have in common. I'm not happy until I have 100% coverage, in numerous different ways, and often go way overboard.

        Test envy? XD