comp.lang.ada
 help / color / mirror / Atom feed
From: Erik Magnuson <maderikm@my-deja.com>
Subject: Re: Bad coding standards - aesthetics are irrelevant
Date: Thu, 28 Dec 2000 16:05:13 GMT
Date: 2000-12-28T16:05:13+00:00	[thread overview]
Message-ID: <92fobl$f93$1@nnrp1.deja.com> (raw)
In-Reply-To: 3A429639.53D3EA9E@acm.org

In article <3A429639.53D3EA9E@acm.org>,
  Marin David Condic <mcondic.nospam@acm.org> wrote:
> Not everything about style - including asthetics - can be resolved
effectively
> by a machine. For example, you might have an identifier: Rotor_RPM.
Automatic
> case rules would have a hard time noting that RPM is an abbreviation
and
> should be upper case. Or it could just preserve case as it was given,
but then
> what stops someone from writing rotor_rpm which might violate the
coding
> conventions?

Way back when I wrote* an Ada pretty-printer, I used a simple rule:
Preserve the case of the 1st usage you see for each identifier and make
all the rest conform to that case. If you were processing multiple
files, you could "seed" the pretty-printer with exceptions like
Rotor_RPM. The other common approach is to have a second pass change
all of the project std. acronyms, but I thought my approach was more
general.

--
Erik

* OK, I did not write it from scratch. I modified one of the ones from
the old Ada source code archive.


Sent via Deja.com
http://www.deja.com/



  parent reply	other threads:[~2000-12-28 16:05 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-12-20 22:22 Bad coding standards - aesthetics are irrelevant Singlespeeder
2000-12-20 23:46 ` Larry Kilgallen
2000-12-21  4:12 ` Robert C. Leif, Ph.D.
2000-12-21 11:33   ` Robert Dewar
2000-12-21 15:59 ` Stephen Leake
2000-12-21 19:30   ` William Starner
2000-12-21 20:54     ` Florian Weimer
2000-12-22 21:33       ` William Starner
2000-12-22 14:57     ` Bruce or Tracy
2000-12-23  8:04       ` Simon Wright
2000-12-28  0:54         ` mark_lundquist
2000-12-22 15:06   ` Ira D. Baxter
2001-01-03 20:02   ` Wes Groleau
2000-12-21 23:46 ` Marin David Condic
2000-12-22  6:45   ` mark_lundquist
2000-12-28 16:05   ` Erik Magnuson [this message]
2000-12-28 20:16     ` Marin David Condic
2000-12-29  4:05       ` Robert Dewar
2000-12-29 12:19       ` Larry Kilgallen
2000-12-29 14:02       ` Tarjei T. Jensen
2000-12-29 16:23         ` Robert Dewar
2000-12-29 14:44       ` Erik Magnuson
2001-01-03 20:12   ` Wes Groleau
replies disabled

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