Andrey Tarasevich writes:
>On 09/28/24 10:47 PM, Tim Rentsch wrote:
>efer?
>>>
>>> Er... The answer to his question is already present in the quoted
>>> portion of my post. "The vertical spacing introduced..."
>>
>> Does that mean you think this
>>
>> if (failed) {
>>
>> ...
>>
>> } else {
>>
>> ...
>>
>> }
>>
>> is just as readable? Or is it something besides the
>> vertical spacing that bears on your "more readable"
>> judgment?
>
>No, the spacing in question is the spacing between the `if` condition
>and the first line of the the first compound statement.
>
>This is unreadable and unacceptable
>
> if (condition) {
> whatever1; /* <-- Bad! No vertical separation! */
> whatever2;
> }
>
> for (abc; def; ghi) {
> whatever1; /* <-- Bad! No vertical separation! */
> whatever2;
> }
>
>This is _immensely_ more readable
To you. I find it less readable than the above.
For those of us who started with ed/vi, certain paradigms
evolved - such as ensuring the function name for a function
definition starts in column 1 so you can easily find it
using /^function-name, so
int
main(...)
{
}
is preferrred over
int main(...) {
}
Likewise, the opening brace for the function should start
a line (supporting the '[[' and ']]' vim commands).
(and '%' use useful to match braces).
Indentation should be a sufficient visual cue without wasting
whitespace on useless blank lines.
f = fdopen(fd, "r");
if (f == NULL) {
lp->log("Unexpected error re-opening '%s': %s\n",
filename, strerror(errno));
close(fd);
goto done;
}
|
|