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

Re: Debian coding style?



In article <[🔎] 199905091030.LAA24342@linda.lfix.co.uk>,
Oliver Elphick <olly@lfix.co.uk> wrote:
>Zygo Blaxell wrote:
>  >>10. Function/method size: bigger is not better. Functions and methods shoul
>      >d
>  >>be kept to a maximum of 40-50 lines. Larger methods should be broken down
>  >>into several smaller methods.
>  >
>  >It would appear that this rule combined with the 78-column line length is
>  >designed to make all functions fit on a single page of printed paper. This
>  >is a completely arbitrary decision (why 78? Why not 130? Why 50 lines,
>
>I have noticed that many laser printers, that have been left at their
>default settings, print 78 characters and throw away the rest of the line.

This really just defers answering the question, though.  

	"Why 78 characters per line of code?"  
	"Because the laser printer wants that."
	"Why does the laser printer want that?"  
	"Uhhh...because IBM made a business decision in the 1950's?"

Change the font and suddenly you have 156x100 pages.  Rotate 90 degrees
and you have 100x156 pages.  Maximize your xterm and you have a 210x76
page or a 252x141 page.

The real point is that decisions about the sizes of functions in a program
should not be controlled by accidents of history.  The problem is not the
choice of which constant magic number, it is that a constant magic number
has been chosen and will be applied as a quality metric to source code.

-- 
Zygo Blaxell, Linux Engineer, Corel Corporation.  zygob@corel.ca (work) or
zblaxell@furryterror.org (play).  Corel may disagree with my opinion (above).
Linux washu 2.2.4 #3 Mar 28 23:20 EST 1999 i686 up 1 day, 9:54
Linux hysterical 2.0.35 #1 Aug 9 17:26 EDT 1998 i486 up 28 days, 13:40


Reply to: