Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: On what column do you wrap your code?

by radiantmatrix (Parson)
on Feb 10, 2006 at 21:01 UTC ( #529463=note: print w/ replies, xml ) Need Help??


in reply to On what column do you wrap your code?

I tend toward 80. Why? Hm, well...

  • 72 is much too short when using a 4-char indent level: two levels in and I end up wrapping simple open ... or die "Can't write $filename: $!" calls.
  • 78 would be ok, but WHY?
  • Anything over 80 seems impolitic; I can always expect that someone can view and edit an 80-column line, but much longer and I fear making a production for someone else to deal with my code.

So, I voted 80, but I'm not strict about it. If I'm maintaining code I try to derive and follow the existing wrapping rules (and other style elements). Some lines just feel like they need to be longer than 80 chars, and I'm willing to let those "break" the wrapping rules.

<-radiant.matrix->
A collection of thoughts and links from the minds of geeks
The Code that can be seen is not the true Code
I haven't found a problem yet that can't be solved by a well-placed trebuchet


Comment on Re: On what column do you wrap your code?
Download Code
Re^2: On what column do you wrap your code?
by Juerd (Abbot) on Feb 16, 2006 at 11:52 UTC

    78 would be ok, but WHY?

    The usual argument says stuff about terminals not being able to handle characters in the last column correctly (then why the hell HAVE that column?), and 80-2 allowing the text to still be 80 wide after adding "> ", the quotation mark used in email.

    However, I wouldn't even use such a terminal, and the quoting argument doesn't hold given replies to replies, when another "> " is added. And I indent all code (a habit I got from POD, and I like it) in mail anyway.

    So I think 78 makes no sense at all, and this is one of the guidelines in Perl Best Practices that I choose to ignore. It's 80 for me.

    Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }

      My guess is 78 came about because 'diff' requires two columns for the '< ' and '> '. That seems sensible.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (8)
As of 2014-09-20 02:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (151 votes), past polls