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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,808505c9db7d5613 X-Google-Attributes: gid103376,public From: ok@goanna.cs.rmit.edu.au (Richard A. O'Keefe) Subject: Re: Looking for good Ada95 book Date: 1996/11/18 Message-ID: <56p9tl$bei$1@goanna.cs.rmit.edu.au>#1/1 X-Deja-AN: 197185512 references: <32723F6A.54A3@dtek.chalmers.se> <32750568.123@essi.fr> <01bbc5d8$a3b24e00$6a9148a6@cornerstone.mydomain.org> <55955a$n04@felix.seas.gwu.edu> <563ikc$ipl@felix.seas.gwu.edu> <19961110155556618957@dialup102-5-9.swipnet.se> <199611111501281395400@dialup81-4-2.swipnet.se> organization: Comp Sci, RMIT, Melbourne, Australia nntp-posting-user: ok newsgroups: comp.lang.ada Date: 1996-11-18T00:00:00+00:00 List-Id: lars.farm@ite.mh.se (Lars Farm) writes: >I have seen so many styles over the years, and so many heated debates >about the subject that I am convinced that this is not a small point to >the individual. Most of us have strong opinions. You obviously have. I >do[1][2] and Michael Feldman seems to have opinions too. Interestingly >all three of us have different opinions on what is and is not readable. >There is no right or wrong. There is only opinion. There will never be >consensus over an entire user community. "Right" and "wrong" there may not be, but there _are_ "better" and "worse", and for a given set of intended readers, which style is more effective for communication can be objectively measured in fairly obvious ways. I note that my own personal *preference* is for lower_case_identifiers, and for many years have stubbornly refused to follow the one-time C convention of writing macro names in upper case. However, when I write Ada code I *do* follow the AQ&S guidelines, my own preferences notwithstanding. Why? Because when I write C code, I am writing for myself, but when I write Ada code, I am writing to be *read* by other people who have access to the AQ&S, so following the style in the LRM and SQ&S helps me communicate with LRM-and-AQ&S-readers. I would certainly expect the entire Ada community to be aware of the AQ&S guidelines: the price is unbeatable and the advice of _all_ kinds (not just layout and capitalisation) is *extremely* handy. I can think of no Ada programmers who would *not* benefit from reading the AQ&S. It's a bit like natural languages. There are "prestige" dialects, and there are perfectly good dialects which nevertheless confine you to the comic stage. In the Ada community, there is only one "style" dialect which enjoys "prestige", and that is the AQ&S dialect. Write in lower_case, and people say "oh, you're a C hacker, aren't you?" Write in UPPER_CASE, and if you're _lucky_, people will say "didn't you know that the revised AQ&S dropped that recommendation as a mistake; nowadays Ada programmers use Mixed_Case". (Put every letter in lower case except for the first in a file and the first after each semicolon, and you will have a consistent defensible style which will confine you to the comic stage. I have seen this style once.) >I have come to accept that this is the way of things. Look at C or C++. >A much larger user base and much larger diversity of styles and naming >conventions. This is not because of language (it requires lower case >keywords). Actually, it _is_ because of language. Ada is not case sensitive, so it is possible to use the AQ&S conventions when _using_ a package whatever convention was used to _write_ the package. C is case sensitive, so the case convention used by a module author is enforced on the module user, like it or not. >Allow different styles, learn to live with and even appreciate >diversity. P.J.O'Rourke, where are you when I need you? Touchy-feely is all very well when you are talking about works of art, although even then, the extreme artist-centred nature of Modernism resulted in a lot of works of little or no appeal to anyone else. We must never lose sight of the fact that programming languages are *not* natural languages, they are artefacts built to serve a very specific purpose: a programming language is supposed to help human beings communicate algorithmic intentions to other human beings and to machines. Anything which helps this is good. Anything which harms this is bad. The kind of diversity here harms communication, for several reasons. One obvious point is that if X -vs- Y is left as a matter of stylistic variation, then X -vs- Y is not available for *communication*. I once worked on an assembler that was worked on by four other people at the same time. We were using Burroughs Algol. For almost any line in that file, you could tell who wrote it. In fact, since I changed my style during that time, you could tell _when_ parts of it were written. People indented by 2, 3, 4, or 5. Some people wrote "f(x)" for function calls, some wrote "f (x)", some "f( x )", and some "f ( x )". And so it went. Well, there are more effective ways of keeping track of who wrote what (like your initials punched in the last few columns of the card). I agree that there is room for the personal in programming, but why not spend the creativity on writing first-class comments instead? -- Mixed Member Proportional---a *great* way to vote! Richard A. O'Keefe; http://www.cs.rmit.edu.au/%7Eok; RMIT Comp.Sci.