From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.7 required=5.0 tests=BAYES_00,INVALID_DATE, MSGID_SHORT,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!seas.gwu.edu!mfeldman From: mfeldman@seas.gwu.edu (Mike Feldman) Newsgroups: comp.lang.ada Subject: Re: Enumeration_IO Message-ID: <1850@sparko.gwu.edu> Date: 8 May 90 18:32:04 GMT References: <1846@sparko.gwu.edu> <1117@software.software.org> Reply-To: mfeldman@seas.gwu.edu () Organization: The George Washington University, Washington D.C. List-Id: 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 ---------------------------------------------------------------------------