in reply to perlstyle - Unclear wording

I wouldn’t say that is unclear, I’d say it makes no sense. “Unclear” would mean there are multiple possible interpretations – in this case, though, I can’t find even one. How does a parenthesis “match on current line”?

Makeshifts last the longest.

Replies are listed 'Best First'.
Re^2: perlstyle - Unclear wording
by thor (Priest) on Nov 18, 2005 at 14:48 UTC
    How does a parenthesis “match on current line”?
    Like-a-so:
    ( ($a eq "foo") && ($b eq "bar") )
    In each case, the close parens "matches" it's open parens (the converse is also true). So, if it "matches on current line", the open and close are on the same line.

    thor

    Feel the white light, the light within
    Be your own disciple, fan the sparks of will
    For all of us waiting, your kingdom will come

      Doesn’t that make it a strangely particular style rule, though? It doesn’t make sense for someone like me who spaces all parens anyway, as in:

      ( ( $a || $b ) && ( $c || $d ) )

      And it looks weirdly out of place in code of someone who doesn’t, as in:

      (($a || $b) && ($c || $d) )

      Makeshifts last the longest.

        In the same vein, the following points from perlstyle don't make sense for me:
        • Be consistent.
        • Be nice.
        as I am neither. :-) perlstyle is a list of suggestions, not rules. If you like to put spaces around all of your parentheses, then you're obeying the rule by default. If someone follows the second style, they have a couple of choices; they can ignore the "rule" altogether or they can put a space after the far left opening parenthesis (which is what I do, incidentally). I agree that the docs might be cleaned up a little bit with a simple example.

        thor

        Feel the white light, the light within
        Be your own disciple, fan the sparks of will
        For all of us waiting, your kingdom will come