comp.lang.ada
 help / color / mirror / Atom feed
From: Robert Dewar <robert_dewar@my-deja.com>
Subject: RE: Bad coding standards - aesthetics are irrelevant
Date: Thu, 21 Dec 2000 11:33:31 GMT
Date: 2000-12-21T11:33:31+00:00	[thread overview]
Message-ID: <91spqc$tfu$1@nnrp1.deja.com> (raw)
In-Reply-To: NBBBJNOMKDIAJALCEFIJGEFJEBAA.rleif@rleif.com

In article <NBBBJNOMKDIAJALCEFIJGEFJEBAA.rleif@rleif.com>,
  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/



  reply	other threads:[~2000-12-21 11:33 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 [this message]
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
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