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

Re: OT: Why is C so popular?



Steve Lamb wrote:
On Wed, 27 Aug 2003 23:52:35 -0600
Jacob Anawalt <jacob@cachevalley.com> wrote:

Was this code on a Unix system, or did you have one nearby? Did you know about the indent program at the time? (man indent)

It _seems_ to work for me to convert someone elses sytle (or lack of it) in coding C into a format that I like (K&R).


    That's just it, I don't like C indenting any more, period.  It isn't
"someone else's style" that is the problem, it is the fact that it is the
antithesis of how I've grown to like to code.  Lemme put it this way:

C:
if foo
    bar;

Python:
if foo:
    bar

Want to extend it?

Python:
if foo:
    bar
    baz

C:
if foo
    bar;
    baz;

Bzttttt, wrong....

if foo {
    bar;
    baz;
}

what do you do if the indentation is lost? you e.g. copy and paste or email piece of code etc. and it changes spaces into tabs or vice versa or removes newlines or somebody accidentally joins two lines together or otherwise changes formatting... what do you do then? how would you know whether baz was supposed to be part of if or not?

	erik



Reply to: