Jim Jagielski wrote:
> I don't understand all of this... Just because there were some
> bugs in some code because someone forgot the precendence
> rules for C should mean we abandon standard C idioms...
>
> while ((c = getchar()) != EOF)
>
> is like one of the 1st C "shortcuts" people learn and is
> SOP for C coding.
I have no issues with the style above when it fits in one line.
I have no issue with it when it is logically grouped...
if ((c = do_x()) && do_y(c))
But when the thing starts spanning more than one line, I'd think
it's worth the coder's time to decide if
80 col text width
<------------------->
c = do_x();
if (c && do(y(c)) {
doen't end up being more legible.
So nooo mass reformatting, but case by case if the code is more legible
then ya - make it so.