Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

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.

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

Replies are listed 'Best First'.
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 => '', plp_site => '', do_not_use => 'spamtrap' }

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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://529463]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (1)
As of 2018-07-23 00:34 GMT
Find Nodes?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

    Results (458 votes). Check out past polls.