From owner-p4-projects@FreeBSD.ORG Tue Sep 25 23:49:59 2007 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D629D16A41A; Tue, 25 Sep 2007 23:49:58 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8933916A419; Tue, 25 Sep 2007 23:49:58 +0000 (UTC) (envelope-from cnst@FreeBSD.org) Received: from mojo.ru (mojo.ru [84.252.152.63]) by mx1.freebsd.org (Postfix) with ESMTP id EB55113C44B; Tue, 25 Sep 2007 23:49:57 +0000 (UTC) (envelope-from cnst@FreeBSD.org) Received: from [192.168.0.16] (nc-76-4-28-21.dhcp.embarqhsd.net [76.4.28.21]) (authenticated bits=0) by mojo.ru (8.12.11.20060308/8.12.10) with ESMTP id l8PNo05b016735 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 26 Sep 2007 03:50:06 +0400 Message-ID: <46F99E8F.2090505@FreeBSD.org> Date: Tue, 25 Sep 2007 19:49:35 -0400 From: "Constantine A. Murenin" Organization: Google Summer of Code 2007 Student @ The FreeBSD Project User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.7.5) Gecko/20041217 X-Accept-Language: en-gb, en-gb-oed, en, en-us, ru, ru-ru, ru-su MIME-Version: 1.0 To: Oliver Fromme References: <200709251132.l8PBWhli040690@haluter.fromme.com> In-Reply-To: <200709251132.l8PBWhli040690@haluter.fromme.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: Perforce Change Reviews , "Constantine A. Murenin" , Hans Petter Selasky , ticso@cicely.de Subject: Re: PERFORCE change 126745 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Sep 2007 23:49:59 -0000 On 25/09/2007 07:32, Oliver Fromme wrote: > Constantine A. Murenin wrote: > > Hans Petter Selasky wrote: > > > Some things I have in mind: > > > > > > Automatic __FBSDID() at top of C-files. > > > > > > Automatic "static prototypes". > > > > > > Automatic comments before every C-function is defined. > > > > > > Automatic use of typedefs when declaring certain device method functions: > > > > > > static device_attach_t my_attach; > > > > > > Automatically reorder the code so that it follows generic device driver > > > layout. > > > > Automatic renaming of function names like hid_get_descriptor_from_usb() > > and usbreq_get_report_descriptor() into something less wordy. > > FWIW, I like those functions names. As far as I can tell, > they do not violate style(9), and I can't think of a good > reason why verbose names should be forbidden. They do -- take a look how calls to these functions were made in the original diff. Now try to bring those calls to KNF -- good luck. :) > Especially when I have to read parts of the kernel code > which I'm not familiar with (happens sometimes), I really > apreciate it if the name of a function clearly indicates > what the function does, without having to wade through > anouther screenful of unknown code ... You are mistaking the role of documentation and function contracts with function names. All non-local functions should have manual pages; abusing function names does not bring you on the road to clarity. Granted, in the original development it may be easier to use wordy names, but IMHO these names should be normalised shortly after the main development phase of the project is completed. This is C after all, not Java. :-) C.