comp.lang.ada
 help / color / mirror / Atom feed
From: Mike H <newsreader@ada-augusta.demon.co.uk.INVALID>
Subject: Re: Ada for 1st year students
Date: Sun, 12 Oct 2008 00:37:07 +0100
Date: 2008-10-12T00:37:07+01:00	[thread overview]
Message-ID: <YKhi7cZjiT8IFwIr@ada-augusta.demon.co.uk> (raw)
In-Reply-To: 9955de2c-f74a-4c2b-b513-56c130a5f1ee@k16g2000hsf.googlegroups.com

In message 
<9955de2c-f74a-4c2b-b513-56c130a5f1ee@k16g2000hsf.googlegroups.com>, 
amado.alves@gmail.com writes
>And for starting they will even use a package that predeclares
>variables I, J, K, L, M as integers, X, Y, Z as reals, etc. That's my
>approach anyway, logic first, types later. They just include the
>package and voila, by magic, all the variables in the pseudocode are
>there for usage in the same way. Later I will explain this magic, by
>looking inside the package, and then they will redo their programs
>sans that package.

I really do think that types are fundamental to good Ada code. When I 
taught Ada I started with types. Before they even saw a line of Ada code 
I would get class groups discussing 'time' and 'duration'.
- are time and duration interchangeable?
- if you subtract a time from a time, what do you get?
- what about other operations on a pair of time variables?
- what about operations on duration variables
- are there any sensible multiplication or division operations

Usually the discussions got quite heated and that was the object of the 
exercise! By the time they were called to order, their minds were much 
more open to the concept of strict typing (especially those who had had 
other programming experience such as C).

I then gave some simple examples and exercises using a package 
declaration containing pre-declared integers, minutes and time (time as 
minutes since some arbitrary event) to demonstrate how errors at compile 
can be 'friendly'! My 'magic' was to follow that up by showing them the 
package body code.
-- 
Mike Hopkins



  reply	other threads:[~2008-10-11 23:37 UTC|newest]

Thread overview: 118+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-09 16:06 Ada for 1st year students amado.alves
2008-10-09 16:44 ` Vadim Godunko
2008-10-09 17:00   ` Georg Bauhaus
2008-10-09 18:30     ` amado.alves
2008-11-01 12:13       ` Mike H
2008-10-09 18:25   ` amado.alves
2008-10-09 19:09     ` Vadim Godunko
2008-10-09 19:37       ` amado.alves
2008-10-09 16:47 ` mockturtle
2008-10-09 17:06 ` Ludovic Brenta
2008-10-09 19:36   ` Simon Wright
2008-10-14  4:32   ` Randy Brukardt
2008-10-14 10:58     ` amado.alves
2008-10-09 17:27 ` Robert A Duff
2008-10-09 18:35 ` Jeffrey R. Carter
2008-10-09 19:36   ` amado.alves
2008-10-09 19:42 ` amado.alves
2008-10-09 20:05   ` ahab
2008-10-09 21:01   ` Pascal Obry
2008-10-09 21:13     ` Ed Falis
2008-10-09 23:14       ` amado.alves
2008-10-10  0:49         ` Jeffrey R. Carter
     [not found]         ` <D9OdnXWk_MQQOXPVnZ2dnUVZ_gWdnZ2d@earthlink.com>
2008-10-10  9:54           ` amado.alves
2008-10-10 17:44             ` Georg Bauhaus
2008-10-15 10:40     ` amado.alves
2008-10-15 11:00       ` christoph.grein
2008-10-15 11:14         ` amado.alves
2008-10-15 11:50           ` christoph.grein
2008-10-15 17:34             ` Georg Bauhaus
2008-10-15 22:30               ` amado.alves
2008-10-16  7:45                 ` christoph.grein
2008-10-16  9:12                   ` amado.alves
2008-10-16 10:15                     ` christoph.grein
2008-10-16 11:17                       ` Niklas Holsti
2008-10-16 11:35                         ` amado.alves
2008-10-16 19:24                         ` sjw
2008-10-17 12:00                           ` amado.alves
2008-10-16 16:26                     ` Pascal Obry
2008-10-16 18:15                       ` amado.alves
2008-10-16 19:14                         ` sjw
2008-10-17 11:59                           ` amado.alves
2008-10-16  9:42                   ` Common Configuration Settings (was: Ada for 1st year students) Georg Bauhaus
2008-10-16 10:24                     ` christoph.grein
2008-10-16 11:20                       ` Common Configuration Settings Georg Bauhaus
2008-10-16 11:37                         ` amado.alves
2008-10-15 13:57           ` Ada for 1st year students Pascal Obry
2008-10-15 15:20             ` amado.alves
2008-10-15 12:51         ` Dmitry A. Kazakov
2008-10-15 15:34           ` amado.alves
2008-10-25 19:06             ` Marco
2008-10-15 11:08       ` Jean-Pierre Rosen
2008-10-15 15:19         ` amado.alves
2008-10-10  0:09 ` Gene
2008-10-10  1:15 ` Jeffrey Creem
2008-10-10 10:04   ` amado.alves
2008-10-11  0:15     ` Jeffrey Creem
2008-10-11 13:46       ` amado.alves
2008-10-11 14:46         ` Dmitry A. Kazakov
2008-10-11 20:43           ` amado.alves
2008-10-11 20:57             ` amado.alves
2008-10-11 23:37               ` Mike H [this message]
2008-10-12  1:06                 ` (see below)
     [not found]               ` <LIydnQ3Px5JC1WzVnZ2dnUVZ_h2dnZ2d@earthlink.com>
2008-10-12  1:37                 ` Gary Scott
2008-11-01 12:09               ` Mike H
2008-10-11 12:54     ` John McCormick
2008-10-11 13:35       ` amado.alves
2008-10-13 23:17         ` Gene
2008-10-11 14:08       ` amado.alves
2008-10-13 12:51         ` Colin Paul Gloster
2008-10-13 20:07           ` amado.alves
2008-10-14 11:56             ` Colin Paul Gloster
2008-10-11 14:12       ` amado.alves
2008-10-11 16:20       ` (see below)
2008-10-12 13:00         ` John McCormick
2008-10-12 14:53           ` amado.alves
2008-10-12 15:31             ` Gary Scott
2008-10-12 16:19               ` Georg Bauhaus
2008-10-13 13:06                 ` Colin Paul Gloster
2008-10-13 15:29                   ` Georg Bauhaus
2008-10-13 16:01                     ` Colin Paul Gloster
2008-10-14 14:17                       ` Georg Bauhaus
2008-10-13 20:13                   ` amado.alves
2008-10-12 14:56           ` Dmitry A. Kazakov
2008-10-13 13:10             ` Colin Paul Gloster
2008-10-13 14:08               ` Dmitry A. Kazakov
2008-10-13 14:26                 ` Colin Paul Gloster
2008-10-13 14:46                   ` Dmitry A. Kazakov
2008-10-14 12:03                     ` Colin Paul Gloster
2008-10-14 12:25                       ` Dmitry A. Kazakov
2008-10-13 15:52             ` John McCormick
2008-10-11 17:44       ` Simon Wright
2008-10-13 14:22 ` Colin Paul Gloster
2008-10-13 20:27   ` amado.alves
2008-10-19 20:49 ` Michael Feldman
2008-10-21 11:16   ` amado.alves
2008-10-22  0:41     ` John McCormick
2008-10-22  8:50       ` amado.alves
2008-10-22  9:26         ` Georg Bauhaus
2008-10-22 11:07           ` amado.alves
2008-10-22 18:02           ` Jeffrey R. Carter
2008-10-22 19:26             ` Adam Beneschan
2008-10-22 20:31               ` Jeffrey R. Carter
2008-11-04 15:31             ` amado.alves
2008-11-04 18:16               ` Colin Paul Gloster
2008-11-05 15:30               ` John McCormick
2008-11-12 12:23                 ` amado.alves
2008-10-22 18:24           ` Jeffrey R. Carter
2008-10-22 13:38         ` mcollado
2008-10-21 11:30   ` amado.alves
2008-10-21 12:34     ` Peter Hermann
2008-10-21 16:35       ` amado.alves
2008-10-22 13:40         ` Larry A Barowski
2008-10-22 13:33       ` Larry A Barowski
2008-10-22 14:11         ` Britt Snodgrass
2008-10-22 21:48           ` Larry A Barowski
2008-10-25 19:36         ` Marco
2008-10-28  0:49           ` lbarowski
2008-10-28 11:31           ` lbarowski
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox