Date: Sun, 24 Nov 2002 11:08:46 +0100 From: Cliff Sarginson <cls@raggedclown.net> To: freebsd-chat@FreeBSD.ORG Subject: Re: Style(9) question Message-ID: <20021124100846.GC51850@raggedclown.net> In-Reply-To: <20021124090603.GA3172@HAL9000.homeunix.com> References: <20021122193040.GA23078@dogma.freebsd-uk.eu.org> <20021122214405.GA11011@HAL9000.homeunix.com> <8gof8g83w4.f8g@localhost.localdomain> <20021124090603.GA3172@HAL9000.homeunix.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Nov 24, 2002 at 01:06:03AM -0800, David Schultz wrote: > Thus spake Gary W. Swearingen <swear@attbi.com>: > > The OP's complaint might better have been a form of: "there are too many > > requirements in the style guide, and this is one example of a > > requirement which, regardless of the merit of the particular style in > > each developer's mind (or that of whoever controls the style guide), > > costs more than it is worth for these reasons: > > Yes, a few of the requirements in style(9) are unnecessary, but I > don't think they're worth debating. For an example of a *really* > pedantic style guide, see GNU's coding guidelines. (From what I > can tell by looking at GNU software, few people actually follow it.) > "Hello World" > > "1) People waste more time fixing intrusions of the illegal style than > > would be spent by people illegally changing other people's style if > > there were no requirement (those changes being a well-known no-no). > > Some people are just that way. They see something that isn't > asthetically pleasing to them, so they `fix' it. Style(9) is > merely their justification. While it annoys me when someone makes > a bunch of whitespace changes in /etc, I'm willing to live with it. > > > "2) The additional requirement screens out some potential developers who > > won't agree (even grudgingly) to develop under one too many requirements > > which they consider lame and over-burdensome. > Wither ego-less programming ? > What you say is generally true about open source software, but > it's a stretch to apply your reasoning to style(9). I don't think > a good programmer is going to shy away from the FreeBSD Project > because we ask that control statements with single-statement > consequents have no braces. If we asked that no less than one > third and no more than two fifths of all statements be preceded by > the word `please', that would be another story. ;-) > i = 1; /* assign 1 to the variable i */ > > "3) The assumed benefit of a particular standard style has not been > > demonstrated, the style being more likely to be just a idiosyncratic > > artifact of a once-influential developer who got his way as a sort of > > ego-payment for services rendered." > Well, that may or may not be true. Writing a style guide does not make you any friends, and I hardly considered it a reward when I had to write some...having the grandiose title at the time of "Design Authority" on a project. This basically meant everyone ignored them (I think actually that nobody read them). Of course a "style" is just one person's idea of what a program should look like. I managed to convince a couple of people that some things were beneficial, others I did not. So it goes. I resorted at times to the rather pathetic reasoning that my style was 90% in the tracks of K&R's book. > Many of the requirements exist because nobody cares enough to > reformat all of the code in a new style. That's probably why you > see a number of K&R-isms as well. If you want to change style(9), > the burden of proof is on you to demonstrate that some requirement > is wrong and harmful; you can't just say ``the benefit [of the > style] has not been demonstrated.'' Standards aren't always the > best solutions, but people still use them because they understand > the value of having standards. (At this point, Terry will > probably chime in with some witty comment about standards.) > Well there is no standard standard for coding style, as far as I know. Maybe we need an RFC :). Even standard standards are not problem free. Network protocols for example do not always cover what to do with non-meaningful information in a packet header (options combinations that make no sense). So everyone makes their own decisions -- hence exploits become available. In the case of code, mistakes by maintainers unused to the coding style of the original programmer are made more likely. Mmm. For some reason that reminds me of an ex-assembly programmer I worked with who multiplied things by 2 using left shifts..."more efficient" he would say..hee hee. He didn't care about the mystification that may cause in those who followed him. Presumably they would know what such a statement did, but not why it was done that way. Can someone tell me if working code has ever been rejected from FreeBSD sources because it grossly violated the style guidelines ? -- Regards Cliff Sarginson The Netherlands [ This mail has been checked as virus-free ] To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-chat" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021124100846.GC51850>