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=3.5 required=5.0 tests=BAYES_40,INVALID_DATE, TO_NO_BRKTS_PCNT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1e68e8c494be59b0,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-01-05 13:06:54 PST Path: nntp.gmd.de!newsserver.jvnc.net!netnews.upenn.edu!news.amherst.edu!news.mtholyoke.edu!uhog.mit.edu!bloom-beacon.mit.edu!gatech!howland.reston.ans.net!paladin.american.edu!auvm!SPLAVA.CC.PLATTSBURGH.EDU!MCCORMJW Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU Newsgroups: comp.lang.ada X-Envelope-to: INFO-ADA@VM1.NoDak.EDU X-VMS-To: IN%"INFO-ADA@VM1.NoDak.EDU" X-VMS-Cc: MCCORMJW MIME-version: 1.0 Content-transfer-encoding: 7BIT Message-ID: <01HLHR8OXQ268X0D1D@splava.cc.plattsburgh.edu> Date: Thu, 5 Jan 1995 16:06:54 -0500 Sender: Ada programming language From: John McCormick Organization: SUNY at Plattsburgh, New York, USA Subject: "Subtract C, Add Ada": More Details Date: 1995-01-05T16:06:54-05:00 List-Id: The sidebar in the December 12 issue by Peter Coffee was abstracted from a post I made to the Ada Section of the CLMForum of Compuserve in response to a request for Ada success stories. Since this article has aroused some interest on c.l.a., I thought I would post the original to INFO-Ada. John ----------------------------------------------------------------------------- I teach a Real-Time / Embedded Systems course for undergraduate computer science students at the State University of New York, Plattsburgh. My students work in teams of three or four to specify, design, and implement the code to control a large model railroad. The model railroad has 27 independently powered blocks of track, half a dozen reversing loops, and 25 turnouts (switches). I would need over 150 toggle switches to control the layout if I wired it with standard model railroading techniques. I consider a project successful when it can run multiple trains, allow for human control of at least one of these trains, prevent collisions between trains, and detect and handle hardware failures (stuck turnouts, derailed cars, noisy sensors, etc.). A typical project contains about 15,000 lines of code. For the first five years that I offered this course, students implemented their projects in the C language. No team ever completed their project. Every year I supplied the teams with more and more of my solution until I was supplying them with over 50% of the project code. But still no success. About four years ago I decided to try using Ada in the course. I expected a disaster the first semester my students wrote in Ada. I had not yet written any "support" code in Ada; the students would have to write the entire project without any of my usual help. However, I was astonished to find that about half of the teams completed their projects. In succeeding years I have supplied the teams with a couple of "support" packages and now have about 75% of the teams completing their projects. To what do I attribute this remarkable improvement in productivity? I would like to believe that it is a reflection of my refined teaching abilities. However, the only real change made was in the implementation language. In fact, I can point to a number of specific areas in which Ada made my students more productive (C horror stories available on request.) 1. Elimination of single key-stroke errors (= instead of ==, etc). 2. The higher level of abstraction for multi-tasking. 3. The higher level of abstraction for bit manipulation. 4. The higher level of abstraction for data types (far less pointer manipulation to use an ADT like a queue). 5. The Ada program library (team members now know when someone changes a specification). 6. Exception handlers to separate normal processing from error handling. 7. Modularity and information hiding through packages. 8. Encapsulation through private and limited private types. 9. Code reuse through generic units. One final note. Students entering the course had no prior experience with either C or Ada. All had backgrounds in either Pascal or Modula-2. The success in the Real-Time course has convinced all my faculty colleagues to support teaching Ada in our beginning courses. This Spring semester the first students with Ada as their mother tongue will enroll in my course. I can only imagine what these teams will accomplish. =========================================================================== = John W. McCormick Phone (518) 564-2785 = = Computer Science Department FAX (518) 564-7827 = = State University of New York mccormjw@snyplava.bitnet = = Plattsburgh, NY 12901 mccormjw@splava.cc.plattsburgh.edu = = USA = = SUNY Plattsburgh = = where = = Computers + Model Railroading = Digitally Controlled Trains = = = = * * * = = * = = * = = ## ## T = = ######_########_########_#####_#########- = = o o o o o o o o oo OOOO oo\ = ===========================================================================