Path: utzoo!attcan!uunet!ginosko!gem.mps.ohio-state.edu!tut.cis.ohio-state.edu!pt.cs.cmu.edu!drycas!synful
From: synful@drycas.club.cc.cmu.edu (Marc Shannon)
Newsgroups: comp.lang.pascal
Subject: Re: Indenting
Message-ID: <14.2526808a@drycas.club.cc.cmu.edu>
Date: 2 Oct 89 01:24:26 GMT
References: <89273.161831TRM900@PSUVM.BITNET> <89273.185750TBC101@PSUVM.BITNET>
Organization: Computer Club, Carnegie-Mellon University
Lines: 56

In article <89273.185750TBC101@PSUVM.BITNET>, TBC101@PSUVM.BITNET (Thomas B. Collins, Jr.) writes:
> I think the method of indenting should be up to the student, and the
> instructor should only deduct points if a standard form isn't followed.
> In your example:
> 
> [ Pascal code segment intentionally left blank. :-) ]

I think that it would be better to say `reasonable' form rather than standard. 
Suggesting a standard form makes it seem like there might be a distinction
between indenting Begin...End blocks and not or even the number of spaces (or
tabs!) for each level of indenting.

> I would of taken off points for not using lowercase text (a pet peeve of

Do you mean if the entire program is uppercase only or just in general?  Many
people find that it suits them to put Pascal keywords (and special predefined
routines) in uppercase to separate them from the programmer-created
identifiers.

> mine), and also for the fact that a begin and end bracket a single
> statement (after the IF).  Then again, this is my opinion, and if your
> teacher is adamant about the form you should follow, I'd say conform to
> their form, but revert to yours when you've finished the class.

Sometimes, a Begin...End statement is required after an If statement,
especially when there is another If statement inside.  Example:

   .
   .
   If TablePtr <> Nil Then
      Begin
         If TablePtr^.Name = SearchString Then
            Writeln('Found entry with ID #', TablePtr^.IDNum:0)
      End
   Else
      Writeln('ERROR: Argument has Nil value');
   .
   .

Note that because there is an `Else' clause to the first If statement, the
Begin...End block is used to delineate to which If it belongs.

The only reasons I can understand for deduction of points are when the code is
unreadable or ambiguous and when comments are either absent, not indicative of
actual function, or superfluous (how many times have you seen "I := I + 1;
{ increment counter I }"? :-) ).

--Marc

-- 
+-----------------------------------------------------------------------------+
| Marc Shannon                                 Internet Address (Bitnet name) |
| VAX Systems Programmer               SYNFUL@DRYCAS.CLUB.CC.CMU.EDU (DRYCAS) |
| Carnegie-Mellon University                  R602MS5U@VB.CC.CMU.EDU (CMCCVB) |
| (412) 268-6290              "I mean, really, what could possibly go wrong?" |
+-----------------------------------------------------------------------------+