develooper Front page | perl.perl5.porters | Postings from April 2010

Re: RFC: Perl manual pages -- update to follow the perlstyle.pod guidelines

Thread Previous | Thread Next
From:
H.Merijn Brand
Date:
April 5, 2010 06:50
Subject:
Re: RFC: Perl manual pages -- update to follow the perlstyle.pod guidelines
Message ID:
20100405155028.042c7760@pc09.procura.nl
On Mon, 5 Apr 2010 09:33:39 -0400, Brad Baxter <bmb@mail.libs.uga.edu>
wrote:

> On Sun, Apr 4, 2010 at 7:22 AM, Jari Aalto <jari.aalto@cante.net> wrote:
> > It can be made visually distict by alternative means. You do not need to
> > type monotonic "one space" around every word:
> >
> >    close FH or die "can't close $path: $!";          # bad
> >
> >    close FH  or  die "can't close $path: $!";        # better
> >
> 
> I disagree with "bad", and I disagree with "better".  Sorry.
> 
> I, for one (perhaps literally), think this
> 
> function( a, b, c );
> $hash{ $x };
> $array[ $i ];
> 
> is better than this
> 
> function(a, b, c);
> $hash{$x};
> $array[$i];

Abigail prefers (IIRC)

  $hash {$x}
  $array [$i]

and I prefer

  function ($a, $b, $c);
  $hash{$a};
  $array[$i];

so many people, so many preferences. None is better or safer than the
other, and sure none is the `best'. They all have to do with how your
mind wraps about the logic you want to express in your code. The best
is IMHO the style that the complete team can agree on. So no-one will
be coding in a style he/she appalls.

Two spaces (or more make sense when aligning stuff

  $a  = 1;
  $br = "<br />";

and - in my case - for functions

  step1    ("bread");
  step15   ("milk");
  step2    (102);
  steps3_6 ("Yummie");

And even if you have (as a team) a very strict policy in alignments or
horizontal white-space, there are enough spots to make exceptions for
whatever valid reason.

> so I'm not shy about an extra space around tokens.
> But *two* extra spaces?  Unless it's to align things
> vertically, then no, please, not in documentation.

I agree

-- 
H.Merijn Brand  http://tux.nl      Perl Monger  http://amsterdam.pm.org/
using & porting perl 5.6.2, 5.8.x, 5.10.x, 5.11.x on HP-UX 10.20, 11.00,
11.11, 11.23, and 11.31, OpenSuSE 10.3, 11.0, and 11.1, AIX 5.2 and 5.3.
http://mirrors.develooper.com/hpux/           http://www.test-smoke.org/
http://qa.perl.org      http://www.goldmark.org/jeff/stupid-disclaimers/

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About