comp.lang.ada
 help / color / mirror / Atom feed
From: dog.ee.lbl.gov!hellgate.utah.edu!caen!uvaarpa!haven.umd.edu!cs.wvu.wvnet. edu!eichmann@ucbvax.Berkeley.EDU  (David Eichmann)
Subject: Re: Ada micro Style for Programs in Introductory Textbooks
Date: 5 Sep 91 21:53:11 GMT	[thread overview]
Message-ID: <1896@h.cs.wvu.wvnet.edu> (raw)

pattis@june.cs.washington.edu (Richard Pattis) writes:

>  I recently received some reviews for a CS 1 (Introduction to Programming) in
>Ada textbook. I was criticized (to varying degrees) for not typesetting my Ada
>code according to the standard established in the LRM.  I would like to appeal
>to the net for some advice. Should I toss out my own style and typeset my code
>exactly like the LRM?
....
>  1) Ada's words (whether reserved words or predefined identifiers - see
>point 2) should be easily identified; ....

>  2) To beginners, there is little difference between Ada's reserved words
>and the predefined identifiers. ....

>  3) Mixed case identifiers (user defined) are easier to read than all upper-
>case or all lower-case (even with underscores).  ....

   It's my personal belief that a typesetting style should be defined with
a particular goal in mind, and that in the case of that special class of
expression we call programs that goal should be the maximal transferral
of semantic intent for the tokens used.

   Consider first the means of expression that we have in a standard editing
environment - we can capitalize or not, and we can embed underscores.  The
other traditional typsetting mechanisms (bold, underscoring, italics, etc.)
are unavailable.

   Then consider how we examine the actual expression of a program, i.e.,
the statements.  I doubt very much if even CS1 students spend a great deal
of time pondering the meaning of IF as a *token*, whereas the meaning of
CurrentFuelFlashPoint, current_fuel_flash_point, etc. deserves much more
attention.  The reserved words serve as focussing agents for the underlying
abstraction.  The identifiers, constants, and so on convey semantics whenever
they occur.

   This leads to my primary point: ALL CAPS draws attention, but people (and
they are the important readers of programs), with the exception of those
chained to EBCDIC, do not write in all caps, they write in a mixture of
upper and lower case, with the upper case characters usually indicating
some form of semantic boundary.  This implies that CAPS should be used
for tokens providing structure and mixed case for tokens providing semantics.

>  4) I have seen styles ....

   My CS1 students have enough problems dealing with the other issues at
hand to spend a great deal of time reflecting upon which of the various
styles espoused by the text they should select.  It's better to select
some suitable style and concentrate on that.  Leave discussions of style
to some lab period.

- Dave
----
David Eichmann
Dept. of Statistics and Computer Science
West Virginia University                  Phone: (304) 293-3607
Morgantown, WV  26506                     Email: eichmann@a.cs.wvu.wvnet.edu

             reply	other threads:[~1991-09-05 21:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1991-09-05 21:53 David Eichmann [this message]
  -- strict thread matches above, loose matches on Subject: below --
1991-09-10 16:36 Ada micro Style for Programs in Introductory Textbooks Mr. D. Harter
1991-09-10  3:47 Robert I. Eachus
1991-09-09 15:31 Ada micro style for programs in introductory textbooks Frank Pappas
1991-09-06 21:09 Ada micro Style for Programs in Introductory Textbooks david.c.willett
1991-09-06 19:56 munck
1991-09-06 18:06 agate!bionet!ucselx!sol.ctr.columbia.edu!spool.mu.edu!tulane!uno.edu!JNCS
1991-09-06 17:48 MARTIN%SCRANTON.BITNET
1991-09-06 12:50 europa.asd.contel.com!darwin.sura.net!noc.sura.net!haven.umd.edu!cs.wvu.w
1991-09-06 10:25 cis.ohio-state.edu!zaphod.mps.ohio-state.edu!caen!uvaarpa!vger.nsu.edu!g_
1991-09-06  2:35 cis.ohio-state.edu!zaphod.mps.ohio-state.edu!usc!elroy.jpl.nasa.gov!jpl-d
1991-09-05 23:52 munnari.oz.au!yoyo.aarnet.edu.au!sirius.ucs.adelaide.edu.au!chook.cs.adel
1991-09-05 21:00 Bill Yow
replies disabled

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