svn commit: r190098 - in head/sys/sparc64: fhc sparc64

Andriy Gapon avg at freebsd.org
Sun Mar 22 01:37:03 PDT 2009


on 22/03/2009 01:57 M. Warner Losh said the following:
> I'll point out that style(9) doesn't say use as few local variables as
> possible...  That part is completely unspecified.

But it does say:
Do not put declarations inside blocks unless the routine is unusually
complicated.

"unusually complicated" is, of course, a very subjective measure.
But still this guideline contradicts typical guidelines for C and its
offspring which name we do not say to declare variables as close to
their first usage as possible.

E.g. you can have a simple 3 line block where you need a local variable
but that block is located 50 lines from start of an enclosing function.
Very convenient when you need to quickly glance the variable's type (not).

So add me to the count of people who has problem with this rule.

P.S.
And 80 symbol line rule (which is not even in style) is also not
justified in modern times, if you'll ask me :)

-- 
Andriy Gapon


More information about the svn-src-all mailing list