comp.lang.ada
 help / color / mirror / Atom feed
From: mfeldman@seas.gwu.edu (Mike Feldman)
Subject: Re: Enumeration_IO
Date: 8 May 90 18:32:04 GMT	[thread overview]
Message-ID: <1850@sparko.gwu.edu> (raw)
In-Reply-To: 1117@software.software.org

In article <1117@software.software.org> blakemor@software.org (Alex Blakemore) writes:
>In article <1846@sparko.gwu.edu> mfeldman@seas.gwu.edu (Mike Feldman) writes:
>
>  You forgot to specify the complete name of the enumeration literal.
>  They are only directly visible where the type is directly visible.
Right. And thanks to the 2 dozen or so folks who pointed this out by e-mail.
I really like getting these notes from Ada folks I've not met before.
 
>  Change
>    > COLOR_IO.PUT(ITEM => C, SET => LOWER_CASE);
>  to
>      COLOR_IO.PUT(ITEM => C, SET => TEXT_IO.LOWER_CASE);
>                                     ^^^^^^^^
Indeed. After eight years of developing Ada code for all kinds of things,
but especially classroom projects and examples, I am going over all my code
and converting to eliminate unnecessary "use" clauses. It's taken me a long
time to buy in to the "avoid the USE" philosophy, but - with some exceptions
- I agree. So now I'm tripping over all the little pebbles associated with
ripping out the "use"s. It's a good exercise. I recommend it. Good for the soul.

>P.S. You're not going to use all caps for everything in your book are you?
>     Too many people think Ada requires LONG_NAMES_WITH_ALL_CAPS_FOR_EVERYTHING
No, I'm not. I'm using a basic style similar to that in Cohen's book. 
(Reserved words in upper case, all else in mixed case, reasonable lengths)
The book is for CS1 students just learning to program. Those kids really
benefit from seeing the reserved words in upper case, because it really
highlights the structural templates used and re-used in programs.
(There is controversy about this; an author needs to make a decision and
stick to it consistently, especially when teaching freshmen...)

Other things Ada can offer freshmen, aside from the obvious stuff like
packages, generics, and the like:

1. Named association of parameters. Kids have trouble matching formals to
   actuals, in any language. The FORMAL => ACTUAL binding that comes so
   naturally with named association really makes learning programming easier!

2. Consistent treatment of enumeration types, especially Enumeration_IO.
   There are freshman books that devote nearly a whole chapter to showing
   how to _write_ Enumeration_IO in Pascal, just to read and write booleans.
   String <-> numeric conversions are also good for the soul, but it's an
   "advanced topic" in the freshman context. Enumeration_IO makes it easy
   to treat enumerations as full members of the scalar-type community, so
   we can encourage their use.

I'll quit here, lest you think I'm pushing a book. I'll be glad to discuss
teaching philosophy by private e-mail. My bottom line is that it's not only
important to teach Ada to college students because it's good for Ada and
industry. It's important because Ada has a _lot_ to contribute to computer
science.
---------------------------------------------------------------------------
Prof. Michael Feldman
Department of Electrical Engineering and Computer Science
The George Washington University
Washington, DC 20052
+1-202-994-5253
mfeldman@seas.gwu.edu
---------------------------------------------------------------------------

  reply	other threads:[~1990-05-08 18:32 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1990-05-08  0:41 Enumeration_IO Mike Feldman
1990-05-08 16:38 ` Enumeration_IO Alex Blakemore
1990-05-08 18:32   ` Mike Feldman [this message]
1990-05-09 22:36     ` Enumeration_IO M Y Ben Gershon
1990-05-10  3:01       ` Enumeration_IO Mike Feldman
1990-05-08 23:53 ` Enumeration_IO M Y Ben Gershon
  -- strict thread matches above, loose matches on Subject: below --
1990-05-08 17:54 Enumeration_IO dritz
2000-04-06  0:00 Enumeration_IO NANCY HEHIR
2000-04-07  0:00 ` Enumeration_IO Jeff Carter
2000-04-07  0:00   ` Enumeration_IO Robert Dewar
2000-04-08  0:00     ` Enumeration_IO Jeff Carter
replies disabled

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