comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: Text_IO for other standard types
Date: 1998/01/17
Date: 1998-01-17T00:00:00+00:00	[thread overview]
Message-ID: <dewar.885058658@merv> (raw)
In-Reply-To: 69q6k3$8fk$1@peuplier.wanadoo.fr


JPR says

<<>
>    (And, P.S.: Try explaining generic instantiation to a room full of
>    non-programming engineers just so you can do simple I/O exercises
>    with them and see how difficult this is!
It's not. Just give it as a "cooking recipe". The first day, I explain that
to get IO's on type Counter, they have to use the magic formula:
   package Counter_IO is new Integer_IO (Counter);
and that they will later discover why (I don't even tell it's a generic
instanciation). People accept it without problems.
>>


I strongly dislike the magic cooking recipe approach. Yes, you can get
students to accept it, but in my opinion damage is done since you
compromise the critical principle that people should understand what
they are doing.

Fortunately, there is a perfectly comfortable way to deal with this, which
is to use the Image attribute, so people can write

	My_Type'Image (val)

Sure, you don't get nice formatting that way, but you can leave nice
formatting for later.

Note that the extension of Image to cover floating-point types is a nice
improvement for this style of teaching.

This is certainly not a big deal, but I see no reason for introducing
magic cookbook formulae when it is unnecessary.





  reply	other threads:[~1998-01-17  0:00 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-01-15  0:00 Text_IO for other standard types Marin David Condic, 561.796.8997, M/S 731-96
1998-01-15  0:00 ` Nick Roberts
1998-01-15  0:00 ` Robert Dewar
1998-01-16  0:00   ` Nick Roberts
1998-01-16  0:00     ` Robert Dewar
1998-01-17  0:00       ` Geert Bosch
1998-01-17  0:00         ` Robert Dewar
1998-01-15  0:00 ` Robert Dewar
1998-01-17  0:00 ` Jean-Pierre Rosen
1998-01-17  0:00   ` Robert Dewar [this message]
1998-01-18  0:00     ` Michael F Brenner
  -- strict thread matches above, loose matches on Subject: below --
1998-01-20  0:00 Marin David Condic, 561.796.8997, M/S 731-96
1998-01-21  0:00 ` Jean-Pierre Rosen
1998-01-19  0:00 Marin David Condic, 561.796.8997, M/S 731-96
1998-01-12  0:00 Marin David Condic, 561.796.8997, M/S 731-96
1998-01-09  0:00 Marin David Condic, 561.796.8997, M/S 731-96
1998-01-10  0:00 ` Tarjei T. Jensen
1998-01-10  0:00   ` Robert Dewar
1998-01-11  0:00     ` Tarjei T. Jensen
1998-01-11  0:00       ` Robert Dewar
1998-01-11  0:00       ` Robert Dewar
1998-01-12  0:00         ` Tarjei T. Jensen
1998-01-10  0:00 ` Nick Roberts
1998-01-11  0:00 ` Jean-Pierre Rosen
1998-01-14  0:00   ` Dale Stanbrough
1998-01-14  0:00     ` Robert Dewar
1998-01-14  0:00       ` Tarjei T. Jensen
1998-01-14  0:00         ` Robert Dewar
replies disabled

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