[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: OT: Why is C so popular?



Steve Lamb <grey@dmiyu.org> writes:

>     Which does not negate the fact that stupid mistakes happen.  The common
> error of... 
>
> if cond
>     bar;
>     baz; 

Why is that a common error?  It just looks wrong to me.  

Maybe I never[1] see this error because of two things:

* I follow the BSD style of braces, so it's perhaps more obvious that
  the braces aren't there than it would be if the opening brace was
  on the same line as the if

* I use Emacs, and I'd have to work hard to misindent like that.

Maybe eventually more editors and IDEs will get decent
autoindenting[2] and coping styles like this can go away.

Footnotes: 
[1]  And I mean, never... I can't remember myself getting bitten by
this in the last 10 years of C.

[2]  As opposed to autoformatting.  Eclipse will autoformat, but you
have to ask for it, and I find that my cow-orkers never do.

-- 
Alan Shutko <ats@acm.org> - I am the rocks.
"These guys have no future!" - Butt-Head



Reply to: