Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^3: using Perl::Tidy/perltidy()

by GrandFather (Saint)
on Apr 19, 2012 at 23:13 UTC ( #966057=note: print w/replies, xml ) Need Help??


in reply to Re^2: using Perl::Tidy/perltidy()
in thread using Perl::Tidy/perltidy()

A 4 space indent is fairly conventional in the Perl world, but really is not critical in any sense. In a C++ context I use a 3 space indent because 2 is too few for me to be able to see correctly a lot of the time and 4 leads to stuff disappearing off the right edge too fast. I use a 4 space indent for Perl because that is most common. Sometimes it is just best to go with the flow!

Personally I really dislike white space on the inside of parenthesis ( like this ), but if you are going to do it at least be consistent (why should the rule be different for while than for for?).

Where there is no other compelling reason to choose one formatting option over another I choose the one that results in code looking the most like conventionally formatted English prose. That is what I parse most and I figure the more my code parser is like my prose parser the fewer parsing errors I'll get.

True laziness is hard work

Replies are listed 'Best First'.
Re^4: using Perl::Tidy/perltidy()
by Aldebaran (Deacon) on Apr 20, 2012 at 19:59 UTC

    alright then, 4 it is. When you think about it, that's fine because you're not dealing with

    int main(){ c everything's indented in the main body return 0; }

    nor does perl have the nested looping that you see so much with explicit indices. In reading the camel and llama book, I don't think I've seen nesting beyond 2 levels.

    If anyone has what they think is an improvement over the default values that might be appropriate for someone coming up on acolyte status, I am--monkishly--all ears.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://966057]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (2)
As of 2021-03-07 03:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favorite kind of desktop background is:











    Results (119 votes). Check out past polls.

    Notices?