C99: Suggestions for style(9)
Andriy Gapon
avg at icyb.net.ua
Tue May 5 15:46:10 UTC 2009
on 01/05/2009 14:56 Maxim Sobolev said the following:
> Christoph Mallon wrote:
>> Roman Divacky schrieb:
>>> I like the part about using as many variables as possible because
>>> of documentation and performance enhancements. I tend to like
>>> the other changes as well..
>>
>> This is not about using as many variables as possible. The goal is to
>> use as many variables as you have logically distinct entities in the
>> function. I suppose, this is what you mean, but I want to clarify this
>> point.
>
> Why don't just put "logically distinct entities" into separate functions
> on their own? It's a good indicator that the re-factoring is due when
> you reach this point.
I think that you overreach.
A very trivial example.
An array and an index into the array are two sufficiently "logically distinct
entities" [as to be different variables]. But they are sufficiently related to be
used in the same function.
--
Andriy Gapon
More information about the freebsd-hackers
mailing list