Liste des Groupes | Revenir à cl c |
On 09/28/24 10:47 PM, Tim Rentsch wrote:I hope you are aware that that is, at best, a personal opinion? Given that a great many C programmers write code that way and find it both readable and acceptable - indeed preferable to your own style - your claim is obviously factually incorrect.
efer?No, the spacing in question is the spacing between the `if` condition and the first line of the the first compound statement.>>
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?
This is unreadable and unacceptable
This readability problem exists one the other end with struct declarations and `do{}while` syntax as wellNote that the "one true brace" style has no problem here and is consistent in these cases. Consistency is not necessarily of overriding importance, but it often helps readability.
I don't have a perfect solution for this variation of the same issue. So, I tend to use
typedef struct MyStruct
{
int a;
double b;
char c;
} MyStruct;
do
{
whatever1;
whatever2;
} while (condition);
although admittedly this has its own drawbacks.
Les messages affichés proviennent d'usenet.