Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Jan 2005 13:49:21 -0500
From:      Garance A Drosihn <drosih@rpi.edu>
To:        Paul Richards <paul@originative.co.uk>, arch@freebsd.org
Subject:   Re: c99/c++ localised variable definition
Message-ID:  <p0620075abe20310465da@[128.113.24.47]>
In-Reply-To: <20050128173327.GI61409@myrddin.originative.co.uk>
References:  <20050128173327.GI61409@myrddin.originative.co.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
At 5:33 PM +0000 1/28/05, Paul Richards wrote:
>
>People used to programming in C++ or Perl (and many others) are
>used to defining variables as near to use as possible. This has
>never been possible before in C, but now with c99 it is.

Well, you could get a similar effect by creating a new scope.

>Personally, I find the c++/perl convention to be much less error
>prone and more intuitive and since c99 now supports it too it seems
>the standards body sees the benefits of this approach as well.
>
>So, are we going to start allowing this feature to be used in
>FreeBSD since it would require a pretty major change to style(9).

I used to do it that way (by creating new scopes and defining
variables in there).  The present style(9) caused me to abandon
that practice, and in hindsight I think my routines are probably
better off with all the variable-declarations grouped together.

I don't feel too strongly about it, but I would slightly prefer
that style(9) stay as it is on this.

-- 
Garance Alistair Drosehn            =   gad@gilead.netel.rpi.edu
Senior Systems Programmer           or  gad@freebsd.org
Rensselaer Polytechnic Institute    or  drosih@rpi.edu



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?p0620075abe20310465da>