home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.ada
- Path: sparky!uunet!usc!sdd.hp.com!cs.utexas.edu!asuvax!ennews!enuxha.eas.asu.edu!koehnema
- From: koehnema@enuxha.eas.asu.edu (Harry Koehnemann)
- Subject: Re: FORTRAN bug(was Re: C++ vs. Ada -- Is Ada loosing?)
- Message-ID: <1992Dec16.164712.20051@ennews.eas.asu.edu>
- Followup-To: comp.lang.ada
- Sender: news@ennews.eas.asu.edu (USENET News System)
- Reply-To: koehnema@enuxha.eas.asu.edu (Harry Koehnemann)
- Organization: Arizona State University
- References: <1992Dec11.132942.24054@mksol.dseg.ti.com> <1992Dec11.163811@lglsun.epfl.ch> <1992Dec14.183326.27689@newshost.lanl.gov>
- Date: Wed, 16 Dec 1992 16:47:12 GMT
- Lines: 43
-
- In article <1992Dec14.183326.27689@newshost.lanl.gov> jlg@cochiti.lanl.gov (J. Giles) writes:
- >|> Michael Feldman:
- >|> ...
- >|> x = 1;
- >|> while (x <= 10);
- >|> {
- >|> printf("%d\n", x);
- >|> x++;
- >|> }
- >Without explicitly looking for the above type of error, or having
- >an automated tool which looks for it on your behalf, this could be
- >a difficult to find error. The problem is that programmers look
- >at code and *know* what it's supposed to do. They tend to skim
- >the code looking for glaring errors. They miss this sort of thing
- >because it's next to invisible.
-
- But, that skimming process is a good thing - it's a way of using
- abstraction. I don't concern myself with the details of each statement,
- rather I abstract out the function of a set of statements. Another
- problem is that a programmer is usually thinking in terms of the problem
- domain rather than in terms of the language, which makes it harder
- to locate these little language flukes. Abstraction is an important
- tool, but can stab you in the back when you're not looking.
-
- I've seen the above example on many exams and have always had mixed
- emotions about it. Sure it tests the knowledge of the language, but
- it's not encouraging the abstraction concepts taught in the class and
- may actually be counterproductive.
-
- Another great test question:
-
- i = 1;
- while (i <= 10)
- printf("%d\n");
- i++;
-
- What's the output? The indentation is a pattern we recognize and it's
- easy to "skim" over it and assume we understand something we don't.
-
- For what it's worth.
- --
- Harry Koehnemann Arizona State University
- koehnema@enuxha.eas.asu.edu Computer Science Department
-