[net.lang.mod2] Pascal vs. Modula-2

cjl@iuvax.UUCP (08/02/84)

Recently cited in steveh's notes :
>Use Pascal if:
>       <500 lines (i.e. small simple task)
>       only one person working on it.
>
>Use Modula2 if:
>       requires several modules.
>       multiple people need to work on a project.

and Seaman's notes :
>  Despite Pascal's short commings as a general purpose programming
>  language, I still believe that it is one of the best languages to
>  teach beginning programmers.  Pascal is easier to learn than Modula,
>  and once it is learned the step to Modula will be easy.

there is some discussion about using Pascal in some circumstances.
I have different feeling about it. The single most serious mistake
about Pascal is its strict declaration order that precludes even a 
simulation of program modularization. We have been teaching classes
using Modula-2 for over 1.5 years. We saw students suffer
from Pascal by coding the declarations in Pascal order subconsciously.
Introducing MODULE later normally means correcting a serious bad habit, 
not extending the small core of basic programming idea.
Therefore the idea of MODULE, although new, must be included in 
in the introductory language. It is just too ESSENTIAL to be left out.

An introductory language should be simple, but not too simple.
A "simple" language like Fortran could mean difficulties and pain 
for program developing and maintenance. So even for a small program
I see no reason why Pascal is more favorable than Modula-2. 
We don't mean small programs don't need modularization, do we?

C.J. Lo
Dept. of CSCI, IUPUI

ARPA : cjl@Indiana@CSNet-Relay
UUCP : ...!iuvax!cjl

ags@pucc-i (Seaman) (08/03/84)

Not to nitpick, but C. J. Lo quoted me as saying:

>  Despite Pascal's short commings as a general purpose programming
>  language, I still believe that it is one of the best languages to
>  teach beginning programmers.  Pascal is easier to learn than Modula,
>  and once it is learned the step to Modula will be easy.

I believe it was Ian Kaplan who said that.  I teach an introductory
Pascal course and I would welcome the opportunity to teach Modula-2
as a first language.  Unfortunately, it is difficult to find anyone
in an introductory programming course who hasn't already been exposed
to BASIC, so I don't believe we should worry about people being
corrupted by Pascal.

I would just like to point out (since no one has mentioned it yet in this 
newsgroup) that the August, 1984 issue of Byte is devoted almost entirely to 
Modula-2.  In what I have had time to read so far, I have noticed several 
inaccuracies which seem to indicate that some of the authors don't really 
understand the language.  One example:  it was claimed that sets could not be 
larger than 16 bits (on 16-bit machines).  Apparently the author didn't know 
that you can declare set types other than BITSET.

Several other points raised in the magazine seem to be worthy of discussion,
but I haven't had a chance to look up references yet.  Maybe this weekend.
-- 

Dave Seaman			My hovercraft is no longer full of 
..!pur-ee!pucc-i:ags		eels (thanks to my confused cat).

cjl@iuvax.UUCP (08/06/84)

I must apologize for my mistake about the quoting of the following message :

>  Despite Pascal's short commings as a general purpose programming
>  language, I still believe that it is one of the best languages to
>  teach beginning programmers.  Pascal is easier to learn than Modula,
>  and once it is learned the step to Modula will be easy.

It was Ian Kaplan who said that, not Dave Seaman.

===

I understand that many high school students were corrupted by BASIC.
However there is a good chance the situation may change in the 
near future. ETS (Educational Testing Service) recently just inaugurated
an Advanced Placement Program in Computer Science for high school students 
to obtain first year college credits in Computer Science. Pascal, not
Basic, was chosen as the standard language. Although many high school
teachers are against this decision, Pascal definitely will change
the high school curriculum in a few years. So we probably will have
a Pascal generation from high schools pretty soon. As the high school
teachers are catching up, I think the college education must be updated
as well.

C.J.Lo
Dept. of CSCI, IUPUI

ARPA : cjl@Indiana@CSNet-Relay
UUCP : ...!iuvax!cjl



===

jack@vu44.UUCP (Jack Jansen) (08/07/84)

Dave Seaman says:
> One example:  it was claimed that sets could not be 
> larger than 16 bits (on 16-bit machines).  Apparently the author didn't know 
> that you can declare set types other than BITSET.

That's right, but "Programming in Modula-2" states (chapter 18):

   .... In addition, implementations of Modula are allowed to set a
   limit to the number og elements admissable in base types. THAT LIMIT
   IS USUALLY THE WORDLENGTH OF THE COMPUTER USED ....

(emphasis mine).
So, although it isn't true that sets can never be bigger than 16 bits
on a 16 bit machine, you should better beware that there is a very
good chance that 16 members is the limit.

	Jack Jansen, {philabs|decvax}!mcvax!vu44!jack

ags@pucc-i (Seaman) (08/09/84)

Jack Jensen, quoting my earlier article, says:

>> One example:  it was claimed that sets could not be 
>> larger than 16 bits (on 16-bit machines).  Apparently the author didn't know 
>> that you can declare set types other than BITSET.
>
>That's right, but "Programming in Modula-2" states (chapter 18):
>
>   .... In addition, implementations of Modula are allowed to set a
>   limit to the number og elements admissable in base types. THAT LIMIT
>   IS USUALLY THE WORDLENGTH OF THE COMPUTER USED ....
>
>(emphasis mine).
>So, although it isn't true that sets can never be bigger than 16 bits
>on a 16 bit machine, you should better beware that there is a very
> good chance that 16 members is the limit.

I was discussing the languages, not the implementations.  Need I point
out that implementations of Pascal can also set an upper limit, and that
the limit may be equal to, or even less than, the word length on the
machine?

The Volition Systems implementation of Modula-2 which I use allows sets 
with up to 512 elements.  The type BITSET allows 16 elements.
-- 

Dave Seaman			My hovercraft is no longer full of 
..!pur-ee!pucc-i:ags		eels (thanks to my confused cat).

bob@sdcsvax.UUCP (Robert Hofkin) (08/10/84)

I heard that Wirth was going to change the minimum set size so that
SET OF CHAR would be portable.