[comp.lang.c] indentation: enough already!

crossgl@ingr.UUCP (Gordon Cross) (12/11/88)

Normally, much valuable information can be obtained from this newsgroup but
the recent bantering concerning identation??  Come on, enough already!  My
feeling on this matter is that ANY programmer will ALWAYS be most productive
without artificial restrictions on mundane things as indentation "standards".
Back in my school days, one professor tried to enforce his indentation style
on the class (you could lose up to 25 points for violations!!).  I in
addition to others found "his" style impossible to work with and quickly 
reverted to our own.  When the grades came out, it was as expected:  DOCKED!
Then we took all this to the dean and got the grades reversed.  The dean's
reason was that he felt such requirements had no bearing on a student's
ability to learn how to write good programs.  We should all take heed and
learn a lesson from this!!  As for me, regardless of "standards" I will
continue to code using MY style throughout eternity...


Gordon Cross
Intergraph Corp.  Huntsville, AL
...uunet!ingr!crossgl

mcdonald@uxe.cso.uiuc.edu (12/11/88)

>Back in my school days, one professor tried to enforce his indentation style
>on the class (you could lose up to 25 points for violations!!).  I in
>addition to others found "his" style impossible to work with and quickly 
>reverted to our own.  When the grades came out, it was as expected:  DOCKED!
>Then we took all this to the dean and got the grades reversed.  The dean's
>reason was that he felt such requirements had no bearing on a student's
>ability to learn how to write good programs.  


You were right, and the dean was right, and bully for you, but ...
(on the other hand, I object to deans changing grades, PERIOD) 
there is a reason for imposing a "pretty printing" style on
class assignments: easier to grade, much easier. In fact, simply
having students run things through "indent" might make it easier.

The big problem in computer language courses (except COBOL :-) )
is that professors often refuse to teach the whole language, and 
nothing but the language. For example, around here goto's are
forbidden (for sure in Fortran, and I believe so in C), and
the Fortran professor ABSOLUTELY INSISTS on using control constructs
that have never been in any standard Fortran ( no suffix, II, IV, 66,
or 77), and have never been, to my knowledge, in any a published draft
of F8X. That's like REQUIRING students in a C course (NOT
"Programming the 8086 in C") to use "near" and "far". 

One of my coding rules is that every non-trivial thing I write
(more than two pages) MUST contain at least one goto or continue.
There are two reasons for this: remind me what "continue" does,
as I always forget and have to look it up, and cause me great
pleasure sometimes as, just while I'm walking down the street,
I think of the consternation one of those constructs might cause
if I posted the code in comp.sources.???. :-)

bill@twwells.uucp (T. William Wells) (12/15/88)

In article <3229@ingr.UUCP> crossgl@ingr.UUCP (Gordon Cross) writes:
: Normally, much valuable information can be obtained from this newsgroup but
: the recent bantering concerning identation??  Come on, enough already!  My
: feeling on this matter is that ANY programmer will ALWAYS be most productive
: without artificial restrictions on mundane things as indentation "standards".

Well, I'm glad you labeled it as "your feeling". Because that is all
that it is. And your feeling is wrong.

While I'm not going to advocate any particular indentation style, I am
going to advocate that one must have an indentation style.

Indentation is a matter of readability.  A consistent indentation
style has the following effect: that the reader of the code can use
subconscious processes to determine significant details about the
code, thus leaving his consciousness free to figure out the hard
things. This has two effects: the coder makes fewer errors as he
develops his code, and the maintainer's job is made much, much easier.

: Back in my school days, one professor tried to enforce his indentation style
: on the class (you could lose up to 25 points for violations!!).

Good for him!

:                                                                  I in
: addition to others found "his" style impossible to work with and quickly
: reverted to our own.

And what made you feel that yours was any good? Weren't you in his
class to learn?

:                       When the grades came out, it was as expected:  DOCKED!
: Then we took all this to the dean and got the grades reversed.  The dean's
: reason was that he felt such requirements had no bearing on a student's
: ability to learn how to write good programs.

Boo! Fire the dean! "... those who can't teach, administrate" seems
to describe him all too well.

:                             As for me, regardless of "standards" I will
: continue to code using MY style throughout eternity...

Don't apply to Proximity (the company I work for) for a job, you
won't get one. We have several *very* good C programmers. We all code
to the same standard.  Our existence disproves your belief.

---
Bill
{uunet|novavax}!proxftl!twwells!bill

noren@dinl.uucp (Charles Noren) (12/16/88)

In article <251@twwells.uucp> bill@twwells.UUCP (T. William Wells) writes:
<In article <3229@ingr.UUCP> crossgl@ingr.UUCP (Gordon Cross) writes:
<:                             As for me, regardless of "standards" I will
<: continue to code using MY style throughout eternity...
<
<Don't apply to Proximity (the company I work for) for a job, you
<won't get one. We have several *very* good C programmers. We all code
<to the same standard.  Our existence disproves your belief.

...well said!
-- 
Chuck Noren
NET:     ncar!dinl!noren
US-MAIL: Martin Marietta I&CS, MS XL8058, P.O. Box 1260,
         Denver, CO 80201-1260
Phone:   (303) 971-7930