From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-0.5 required=3.0 tests=BAYES_05,MSGID_SHORT autolearn=no autolearn_force=no version=3.4.5-pre1 Date: 5 Sep 91 21:53:11 GMT 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 Message-ID: <1896@h.cs.wvu.wvnet.edu> List-Id: 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