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=0.7 required=5.0 tests=BAYES_00,MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,259541b8a8a12b6 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2000-12-21 03:40:08 PST Path: supernews.google.com!sn-xit-02!supernews.com!newsfeed.mesh.ad.jp!feed2.onemain.com!feed1.onemain.com!xfer13.netnews.com!netnews.com!feed2.news.rcn.net!rcn!news.maxwell.syr.edu!nntp2.deja.com!nnrp1.deja.com!not-for-mail From: Robert Dewar Newsgroups: comp.lang.ada Subject: RE: Bad coding standards - aesthetics are irrelevant Date: Thu, 21 Dec 2000 11:33:31 GMT Organization: Deja.com Message-ID: <91spqc$tfu$1@nnrp1.deja.com> References: NNTP-Posting-Host: 205.232.38.41 X-Article-Creation-Date: Thu Dec 21 11:33:31 2000 GMT X-Http-User-Agent: Mozilla/4.61 [en] (OS/2; U) X-Http-Proxy: 1.0 x73.deja.com:80 (Squid/1.1.22) for client 205.232.38.41 X-MyDeja-Info: XMYDJUIDrobert_dewar Xref: supernews.google.com comp.lang.ada:3313 Date: 2000-12-21T11:33:31+00:00 List-Id: In article , comp.lang.ada@ada.eu.org wrote: > From: Bob Leif > To: Singlespeeder et al. > > A direct way to enforce an institutional style would be to > build automated tools that reformat the Ada source to > beautiful Ada source. It is no more possible to automate the creation of beautiful Ada source from junk than it is to automate getting fine art from photographs. You can do a crude approximation, but beauty will escape you. A common coding style goes well beyond what can be enforced by tools, it really requires everyone to internalize the general style at all sorts of levels. Just for one example, the use of comments is something that needs to be standardized. A tool can make sure the -- is in the right column, but cannot ensure that the comment is at the right level of semantic abstraction. In the GNAT project, we have a set of coding standards, and many of the simple items are enforced (see the -gnaty switch in GNAT) automatically when we compile. But the level of uniformity goes far beyond that. The way we work is that when someone first comes to the project, their code is carefully reformatted for correct style (by a human, often me :-) and they learn the style from watching these corrections. If you look at the revision histories, a very large percentage says something like "minor reformatting". I don't think it works even at the simple syntactic level to use a tool to *convert* code to a common style, as opposed to *enforcing* the style. If I am a programmer who absolutely insists on using UPPER_CASE names, yes, then I can automatically format to mixed case (well even that's a little tricky and requires exception dictionaries), but it can be done. The problem is that I will not like the result. Yes, for my own code, I can keep a local copy of the NICE_LOOKING_CODE, but what about other people's code? Unless there are tools to go from the common style to each person's idiosyncratic style, you will still get what I call "style lockout", meaning that people do not like to touch code they find ugly. It really is much simpler, and quite practical, to get the whole team using a common style in the first place. Sent via Deja.com http://www.deja.com/