[comp.sys.atari.st] Spring STart

K538915@CZHRZU1A.BITNET.UUCP (06/03/87)

  After getting the spring issue of STart (at last, we get it a bit
late here :-)), the first program I looked at was MACROPIX
(being the Pascal-Fan I am) and after looking at the source I have
serious doubts if the editors of STart have ever seen a line
of decent Pascal source before!

  This is NOT a flame of the person who wrote MACROPIX, but of
the people who managed to publish a program that doesn't have a
single Begin..End block (with the exception of procedure bodies
naturally) in it! Without even trying hard, (30 min. work)
I reduced the source size from 63118 bytes to 52759 bytes and the
size of the executable from 66706 bytes to 57875 bytes and I didn't
even touch the data structures in the program! I estimate that
there is potential for saving another 10 kB in the executable,
just by using better data structures.

  The whole purpose of publishing the source of a program like
MACROPIX is that the readers of STart learn something about
programming style and techniques, but MACROPIX as published is
an example of how NOT to program in Pascal (I find this particulary
annoying in a magzine which has a nasty remark about Pascal by
Dave Small in every issue (I liked the one which went something
like: 'Pascal compilers are notorious for generating inefficent code',
I could just as well claim 'C compilers are notorious for generating
buggy code' which is much easier to prove, just read this news-group
for a week!)).

  I'm sure the author of MACROPIX could have produced a much improved
version of the program if somebody at STart would have looked at
it and made a few suggestions about what to improve.

                          Simon Poole
                          K538915@CZHRZU1A.BITNET

PS: And what about formating Pascal programs in a readable way?
    I normally do it like this:

    {Idiotic program}
    Program SillyProgram;

       Var i : Integer;

       {Write 'Silly1'}
       Procedure Silly1;

          Begin
             WriteLn('Silly1')
          End;

       {Write 'Silly2'}
       Procedure Silly2;

          Begin
             WriteLn('Silly2')
          End;

       Begin {Main}
          For i := 1 To 100 Do Begin
             Silly1;
             Silly2
          End {For}
       End.