Path: utzoo!utgpu!attcan!uunet!ginosko!brutus.cs.uiuc.edu!psuvax1!psuvm!trm900
From: TRM900@PSUVM.BITNET (Tony R. Marasco)
Newsgroups: comp.lang.pascal
Subject: Indenting
Message-ID: <89273.161831TRM900@PSUVM.BITNET>
Date: 30 Sep 89 20:18:31 GMT
Organization: Penn State University
Lines: 42
Disclaimer: The following text may not be the views of Penn State Univ.


  As you know, any good programmer will indent Pascal source inside
every loop, Begin-End structure, etc.  A colleague who is grading
freshman Pascal was instructed to deduct 1 letter grade for non-
indentation.  However, one student submitted the following code:

BEGIN
   WRITELN;
   .
   .
   WHILE (A <> 0) DO
   BEGIN
      IF COUNT <> 0 THEN
      BEGIN
         AVG := TOTAL / COUNT;
      END;
      .
      .
   END;

  Notice how the BEGIN's and END's are not indented, but the code within
is.  Now, I have written programs in Pascal for several instructors and
never had points deducted for the above style (which this other person
used, also).  My question is this:  Is this a judgement call?  I know
books I've read indent the BEGIN's and END's also.  Which is correct?
I really don't think there's an exact answer to that question.
Personally, I think the book's versions are more confusing to me.

  I was there when he was grading the programs & he brought the problem
to my attention.  I told him there was nothing wrong IMHO, but he decided to
take 1/3 of a letter grade off for incorrect indentation.

  I'd appreciate anyone's comments via e-mail on this subject...
-------
+-------------------------------------------------------------------------+
| Tony Marasco                 |  UUCP: psuvax1!psuvm!trm900              |
| Penn State University        |  BITNET: trm900@psuvm.BITNET             |
| Schuylkill Haven Highway     |                   - or -                 |
| Schuylkill Haven, PA 17976   |  trm900%psuvm.psu.edu@CUNYVM.CUNY.EDU    |
| "Questions are a burden for others.  Answers are a prison for oneself." |
|       -- The Prisoner                                                   |
+-------------------------------------------------------------------------+