>> Whenever possible, variables should be declared at point of first
>> assignment, so that it is clear that they have been initialized.

There's nothing that says a top-of-block declaration can't include an
initializer (to a dummy value if necessary).

>> I know of no plausible SE case for declaring variables way up at the
>> top of the block they are defined in other than tradition.

It does make it easier to find the declaration of a variable when
reading the code: check the top of each containing block, rather than
all code up to the beginning of the containing function.  (Of course,
you'd have to decide whether you consider that a "plausible SE case".)

>> It was originally done that way to make it easier for Fortran
>> compilers, AFAIK.

A C feature was done to make it easier for FORTRAN compilers?  I'm not
sure what that could even _mean_.

/~\ The ASCII                             Mouse
\ / Ribbon Campaign
 X  Against HTML                mo...@rodents-montreal.org
/ \ Email!           7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B
_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to