Why choosing Ada as a teaching language?

The following article was posted to comp.lang.ada by Richard A. O'Keefe, Melbourne, Australia.

He describes why they made the move from Pascal to Ada as a teaching language (incl. the first year courses), and answers a lot of wild guesses of a so-called specialist.

Happy reading...

Dirk Craeynest


Article: 13777 of comp.lang.ada
From: ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe)
Newsgroups: comp.lang.ada
Subject: Re: Ada as the first language? GOOD LUCK!
Date: 4 May 1994 17:57:57 +1000
Organization: Comp Sci, RMIT, Melbourne, Australia
Lines: 138

cpitches@crl.com (Craig M. Pitches) writes:
>Then when you finally start getting the idea, it turns out that everying
>is REALLY HARD TO DO! 

So far I have not found this to be the case.  I have found some things
hard to say in Ada, but that's a long way better than being _impossible_
like in some of the other languages I use.  I wish exceptions had been
a bit more like continuations, and I certainly wanted functions as
parameters, but to repeat a .signature I used for a while "the longer I
use C, the better I like Ada."

>Yes, I admit I give no examples, but this is usenet after all. Trust me.

No way.  Proof by assertion is no proof at all.

>So, me, a guy with lots of experience with computer languages.

I don't have to believe _that_ either.  You _named_ a lot of languages,
but provided us with no evidence that you have experience with or
understand any of them.  (Anyone who spells "Prolog" as "PROLOG" makes
me wonder...)

>This leads me to question why one should want to promote Ada as the 
>_FIRST_ language at the university.

Let me tell you why we switched to Ada.
For many years RMIT used Pascal.  But there was a problem.  The Pascal
dialect (1) on the Macintoshes our students used in first year as incompatible
with the Pascal dialect (2) on the UNIX system they used in second and third
year.  Then we had to upgrade our first-year lab, and "never mind the quality,
feel the price" switched to PCs.  So now the Pascal dialect (3) that our
students used on PCs was incompatible with the Pascal dialect (2) that they
were using on UNIX.  Many of the students bought PCs for home use.  The code
they wrote for assignments in second year wouldn't run on the UNIX machine;
the large volume of reusable code I provided on the UNIX machine wasn't any
use on their home machines.  (Yes, dialect (3) has a lot of extensions, but
it doesn't implement the full Pascal standard, which is a pretty small one!)
Then we switch from Encore Multimaxes to Suns, so now the Pascal dialect (4)
on the Suns was incompatible with all 3 of the others.  (E.g. our students
got some very nasty surprises because the SPARCompiler Pascal compiler is
case sensitive *by default*.)

Nobody was satisfied with this state of affairs.
We amalgamated with Phillip Institute of Technology, who had been
successfully using Ada for a couple of years.  (By the way, at the risk
of giving offence to some of the fine people at what is now the Bundoora
Campus of RMIT, the PIT students were in general not, um, in the first
rank of students.)  They _were_ satisified with Ada.

Now our students can run the *same* code on
 - DOS (GWAda/Ed and a commercial product)
 - Mac (Ada/Ed)
 - Sun (Ada/Ed, Sun Ada on some machines, GNAT when it's finished)
 - and the remaining Encore Multimax
Please do not underestimate the importance of this.  You might think we
could have switched to C, but until you've actually moved an Ada program
from machine to machine without changing _anything_ you don't realise just
how much work porting C code was.

>Is it to quickly weed out those who will not perservere?
>Are we raising the stakes for individual success? 
>Just another hurtle? [presumably "hurdle"]

The answers are No, No, and No.
Our students are _not_ finding the parts of Ada we teach them in first year
any harder than Pascal.  In fact, they _and_ the lecturers are finding it
easier.  Pascal has an _unbelievable_ number of "rough edges".

>Ada attempts to meet admirable goals.

They are goals we as a CS department care about.

>However, it is too complex to use as the first language.

You are making the demonstrably false assumption that students have
to use *all* of the language.  I'm not actually involved in the first-
year teaching, but to the best of my belief we don't expect first-year
students to write generics or tasks or to use fixed-point, or for that
matter to master the finer details of packages.  The point is, when they
_do_ need these things, we won't have to teach them another language.
Our students never quite managed to learn all of Pascal in first year
(note the careful distinction between what we _teach_ and what they _learn_).

>The compiler error diagnostics are too primitive. 

A compiler is not a language.  A language is not a compiler.
None of the following language standards (Ada, Pascal, Pascal Extended,
Fortran, Fortran Extended, C, PL/I) specifies the text or format of
diagnostics.  Which Ada compiler are you criticising?
Its diagnostics are primitive compared with what?  If you know of a Pascal
compiler that runs under Solaris and has good performance and excellent
diagnostics, please let me know.  I just tried the experiment of compiling
an Ada file with a Pascal compiler, and in one place I got

           2      type ELEMENT_TYPE is private;
E 18490-----------------------------^---  Expected '='
E 26090--------------------------------^---  Missing/malformed expression

and in another place I got

          13      type STACK_TYPE is record
e 18460---------------------------^---  Replaced identifier with a '='

Two different reactions to the same error (using 'is' instead of '=').
And this in a compiler from a major vendor.  Are you saying all Ada
compilers are _worse_ than this?

>Some compilers can't help you figure out compilation order.

Have you used C++ lately?  Have you read the AT&T release notes?

>Ada is also expensive to get going in. Compilers for cheap computers are 
>even worse than those for the workstations and minis.

Ada/Ed is *free*.  I love it.  Our students have had no major problems
with it.  GNAT is free.

>What the poor student needs is a simple, small, concise language.
>C and Smalltalk meet these requirements.

If you think C is "simple", you don't read comp.std.c.  Read the C standard
(which is actually a fine document) and find out just how much you didn't
know about C.  There is certainly a lot to like about Smalltalk.

>Ada is complex, big, and ambiguous (from the learner's perspective).

A learner does not have to learn the whole language.
It really is possible to start with a Pascal-like sublanguage and
learn one new feature at a time.
As for "ambiguous", I haven't the faintest idea what you are talking about.

_Any_ realistic programming system is going to take a fair bit of learning.
It is good if the core language is really simple (like CLU), but if it's
good for anything there will be a lot of library packages you should some
day learn about, precisely because there are a lot of things we programmers
need to do.  Take Fortran 77:  the core language is actually quite
straightforward, but a good Fortran programmer should be aware of things
like LINPACK, LAPACK, FUNPACK, ELLPACK, ACM CALGO/TOMS, ... the packages
that make Fortran _worth_ knowing.  There is no royal road to learning,
and there is no royal road to programming.

-- 
Richard A. O'Keefe; ok@goanna.cs.rmit.oz.au; RMIT, Melbourne, Australia.
"C is quirky, flawed, and an enormous success."  -- Dennis M. Ritchie.

Dirk Craeynest (Dirk.Craeynest@cs.kuleuven.ac.be)
Ada-Belgium Newsletter Editor & Team Ada