Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!rutgers!cmcl2!adm!xadmx!R1TMARG%AKRONVM.BITNET@cornellc.cit.cornell.edu
From: R1TMARG%AKRONVM.BITNET@cornellc.cit.cornell.edu (Tim Margush)
Newsgroups: comp.lang.pascal
Subject: RE: Indenting
Message-ID: <21041@adm.BRL.MIL>
Date: 4 Oct 89 01:14:43 GMT
Sender: news@adm.BRL.MIL
Lines: 54

>  No, I don't think so.  Personally, I usually avoid redundant
>semicolons, but there is a good reason to put them there: it means
>that lines within a block may be independently modified.
>  If I have some code without the extra semicolon:
>
>        begin
>          i := 1;
>          j := 2
>        end
>
>  and want to add another statement, k := 3, I get:
>
Here is what I get...

        begin
          i:=1;
          j:=2;
          k:=3
        end

and if I want to temporarily insert a debug statement:

        begin
          i:=1;
          j:=2
         ;writeln('the value of j is',j)
         end

Since the writeln is intended for debugging purposes, the semicolon in front
helps me to spot it quickly.  If I was going to modify the code permanently,
I would put the semi where it belongs.  There is no reason that code
modification ought to be "easy!"  We all know that we must take into
consideration surrounding code when making changes.  Adding the semi here is
part of that "reasonable" task.  I still believe that using the semicolon
as a statement terminator is a wrong concept to teach any beginning
student.  It will always make the if then else structure more difficult
as there is no way that you can say that x:=x+1 is a statement one place
but not another!

   x:=x+1;
   if x>5 then x:=x+1; else ...

If statements need terminated, and x:=x+1 is a statement (assignment),
then this ought to be correct syntax...


No... make the semicolon a separator as it was intended.  Encourage your
students to practice this until you are sure they understand the concept!

I consider the NULL statement a topic for "advanced" pascal programmers.

Regarding the question of how other languages do it... If you are
programming in Pascal.. you ought to program in Pascal.. it should not
look like a C or modula-2 program!