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

Re: [Xen-devel] USB virt 2.6 split driver patch series



On Mon, Nov 21, 2005 at 02:01:01PM +0000, harry wrote:
> I have read  Documentation/CodingStyle quite carefully and there is no 
> mention of using braces inside functions.  I'm used to using braces to
> define minimal scopes for local variables which makes the code easier to
> read by minimising the number of variables you need to keep track of
> when reading it and by declaring variables closer to where they are used
> so it is easier to verify that they have been correctly initialised.
> 
> Is this really banned?

most of the time yes.

the only "good" use of anonymous functions are:

- conditional code, to keep variable definition with the code that
  use it, to prevent "variable not use" warnings.
- modifying some old code ..
   (but most of the time a static inline function is way better,
    unless you are using lots of variable from the function)

plus you'll save lots of blanks at the left of the code and lots of
lines, not using them.

-- 
Vincent Hanquez

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.