[GAP] advice on Ada in general programming languages course

Michael Gonzalez mgh at unican.es
Thu Apr 21 20:29:43 CEST 2005


Ted,

Ted Baker wrote:

> I'm looking for ideas on how to "hook" students on Ada ...

I teach a programming course with Ada. We give a brief review of basic 
programming, and then we concentrate on object orientation and abstract 
data structures.

I also face the problem of handling Strings that some people mentioned. 
In the beginning we use a large string and an integer associated with it 
to store the actual length. Later we use a simple var_string package 
that contains a bounded string (with a large bound that is usable in 
most cases) and all the operations required to handle them like if they 
were regular strings, but in a single package (all the operators, Put, 
Put_Line, Get_Get_Line, conversion to upper or lower case, etc.). It is 
just so comfortable to use.

We don't use the "no use" rule. In general, for standard Ada packages 
that everybody knows (e.g., Ada.Text_IO) we put a use clause. For 
uncommon of self-made packages we dont put the use. In this way we can 
get rid of a large pertentage of the repeated package names that make 
programming a bit boring and the text less readable.

To make the programming more enjoyable, instead of the regular text_IO 
we very soon change to Win_IO, a set of packages with window-based input 
& output that is very simple to use and makes more attractive programs 
for the students. You can find a pointer to Win_IO in the GAP server.

Best regards,

Michael.

-----------------------------------------------------------------------
Michael Gonzalez Harbour                  E-mail: mgh at unican.es
Dpto. de Electronica y Computadores       URL: http://www.ctr.unican.es
Universidad de Cantabria                  Phone : +34-942-201483
Avda. de los Castros s/n                  Fax   : +34-942-201402
E-39005 Santander
SPAIN
-----------------------------------------------------------------------



More information about the GAP mailing list