[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Debian coding style?



uwd38znr@umail.furryterror.org (Zygo Blaxell) writes:

> This really just defers answering the question, though.  

> 	"Why 78 characters per line of code?"  
> 	"Because the laser printer wants that."

I tend to think of it more like email -- "Why 72 chars per line?"  "To
leave room for quoting in 80 columns."  "Why 80 columns?"  "Because a
lot of people only use 80 columns, some only *can* use 80 columns,
others just prefer not to use any other width."

> The real point is that decisions about the sizes of functions in a
> program should not be controlled by accidents of history.

Mild disagreement here.  Like tabs=8, the 80-column limit is a good
lowest-common-denominator rule that *will* work for everyone, where
other choices may not.  Yes, it's a historical accident, maybe, but
it's a historical accident that is very firmly entrenched still, and
you violate it at your peril.  IOW, you really have stumbled across
one of our unwritten rules here.

Yes, I can change my tab size, but 8 is a standard, and I'll annoy a
lot of people if I use something else.  Yes I can change my editor's
width, but 80 columns is a standard, and I'll annoy a lot of people if
I use something else.  So, I don't, and then I tend to get annoyed
myself at people who do.

The hard metric of 40-50 lines/function, on the other hand, is just
plain silly.  Write functions that perform one task, and only one
task, and keep the line length under 80 columns, but use as many lines
as you need.  If the function really performs one-and-only-one
function, it will rarely be that long in any case.

I suspect that you'll be hard pressed to find any "open source" code
that doesn't adhere to the 80 column rule.  And if you do find some,
you'll probably find an "open source" author who gets a lot of flames
from his users.  :-)

BTW, I loved your analysis of some of the other Corel Guidelines.  I
nearly fell off my chair at the "passive voice should be avoided"
comment!  :-)

cheers
-- 
Chris Waters   xtifr@dsp.net | I have a truly elegant proof of the
      or    xtifr@debian.org | above, but it is too long to fit into
http://www.dsp.net/xtifr     | this .signature file.


Reply to: