[SPAM] - Re: [GAP] advice on Ada in general programming languages course - Email found in subject

ed schonberg schonberg at gnat.com
Thu Apr 21 20:57:21 CEST 2005


Ted Baker wrote:

>>I also face the problem of handling Strings that some people mentioned.
>>    
>>
In a course of this kind, where language principles are the focus 
(rather than programming skills in a particular language), the handling 
of strings is a good introduction to the general topic of object 
allocation, something that for undergraduates brought up on Java is an 
illuminating topic. It's possible to discuss how:

a) In Ada you can put anything you want on the stack, and the semantics 
of an object do not depend on whether they are on the stack or on the heap.
b) In C++ you can put objects on the stack, but  dynamic arrays can only 
be on the heap.
c) In Java all is reference types, and with the new automatic boxing 
semantics even scalar types can be forced to be indirect.

I think this discussion can also motivate the passage from regular 
strings to unbounded strings , with discussions of performance vs. 
expressiveness and programmer convenience, etc.

Ed


More information about the GAP mailing list