[sf-perl] Do you have a tidy style? Emacs/cperl and perltidy.

Joseph Brenner doomvox at gmail.com
Wed Jan 23 12:35:20 PST 2013


To literally answer the question about what I tend to do:

I find that cperl-mode does a good enough job of handling layout that
I don't often resort to perltidy (though I've noticed that perltidy's
default does a better job of laying out things in columns).   I just
use the perltidy defaults usually (though I'll have to try the -pbp
option).

My own typing habits these days are pretty close to what Conway lays
out in Perl Best Practices....   I  use a lot of whitespace and
braces, like:

  foreach my $item ( @{ $items } ) {

Instead of

  foreach my $item (@$items) {

(I find that most other perl programmer's find this style a little
peculiar, but it doesn't really bother them.)

As I mentioned, I don't really like cperl-mode with cperl-hairy
flipped on, but people shoulder-surfing while I type code have
commented that I apparently do things *like* it unconsciously.
If I open a block, I include a closing brace for the block.

I suspect I do things like this to keep the syntax coloring from doing
distracting things: if you open a quoted-string, it's better to have
it closed immediately, even before you decide what's going in the
string.


More information about the SanFrancisco-pm mailing list