comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <Stephe.Leake@nasa.gov>
Subject: Re: Case dependence and coding standards
Date: 04 Jun 2003 12:32:53 -0400
Date: 2003-06-04T16:49:03+00:00	[thread overview]
Message-ID: <uisrlx0p6.fsf@nasa.gov> (raw)
In-Reply-To: bbkba3$aatu7$1@ID-175126.news.dfncis.de

Vinzent Hoefler <ada.rocks@jlfencey.com> writes:

> Robert A Duff wrote:
> 
> >Vinzent Hoefler <ada.rocks@jlfencey.com> writes:
> >
> >> Robert A Duff wrote:
> >> 
> >> >It would be nicer to have a compiler that simply corrected such errors
> >> >in the source file, instead of complaining about them.
> >> 
> >> Well, I expect a compiler to *read* the source, not actually *write*
> >> it.
> >
> >Sure, that's what we're all used to.  But we expect our editors and
> >pretty-printers and CM systems and so forth to modify our source code.
> 
> Well, let's say it so: I expect it changes the source in the way I
> intended to change the source by hacking on some keys, but never
> automatically.
> 
> >I like to turn on the GNAT switch that complains when I say "Text_io"
> >instead of "Text_IO".
> 
> Yes, me too. And then I fix such typos by hand.

Wouldn't you like your IDE to have a command to fix it for you? (like
Emacs and GPS).

> <snip>
> 
> >  The only kind of laziness I want
> >to inhibit is the kind that causes extra work in the long run
> >(e.g. unreadable code).
> 
> Yes, but I don't see, how not hitting the shift-key at the appropriate
> time to generate readable code isn't laziness. Yeah, I know typos are
> the usual suspects, but fixing them automatically would encourage the
> coder to never use the shift key, because "the compiler fixes it
> anyway". That's laziness and is contrary to my opinion that the code
> has to be readable from the very first start.

I agree that "code has to be readable". But I don't impose that
requirement until after it compiles. Since we rely on the compiler to
catch type and syntax errors, why not also rely on it to catch
capitalization errors?

The goal is overall productivity; how fast I can write good code. It's
faster for me to not worry about hitting the space bar, as long as the
editor and compiler either do it for me or make it very easy to detect
and fix case errors. And yes, _thinking_ about what the capitalization
of an identifier should be takes mental cycles that can be better
spent thinking about the problem solution.

> Its kind of the same problem why quick fixes (aka. dirty hacks)
> become standard some months later... ;)

I disagree. The compiler enforces capitalization, in the same way it
enforces syntax rules. I'm trading brain cycles for CPU cycles, and I
see a net gain. Since I now have more brain cycles available, dirty
hacks are less likely.

-- 
-- Stephe



  reply	other threads:[~2003-06-04 16:32 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-03  5:05 Case dependence and coding standards Fionn mac Cuimhaill
2003-06-03 17:31 ` Robert A Duff
2003-06-03 17:46   ` Vinzent Hoefler
2003-06-03 19:04     ` Robert A Duff
2003-06-03 23:37       ` Randy Brukardt
2003-06-04  2:39         ` Wesley Groleau
2003-06-04 13:28           ` Georg Bauhaus
2003-06-04 15:44             ` Preben Randhol
2003-06-04 22:32             ` Wesley Groleau
2003-06-05 12:01               ` Georg Bauhaus
2003-06-05 15:36                 ` Preben Randhol
2003-06-05 17:41                   ` Wesley Groleau
2003-06-05 17:47                     ` Preben Randhol
2003-06-05 17:51                       ` Preben Randhol
2003-06-05 18:32                 ` Wesley Groleau
2003-06-06  8:58                   ` Georg Bauhaus
2003-06-07  0:53                     ` Wesley Groleau
2003-06-10 15:05                       ` Georg Bauhaus
2003-06-05 17:32               ` Wesley Groleau
2003-06-05 17:43                 ` Preben Randhol
2003-06-04  8:39       ` Vinzent Hoefler
2003-06-04 16:32         ` Stephen Leake [this message]
2003-06-05  1:27           ` Robert I. Eachus
2003-06-05  7:47           ` Vinzent Hoefler
2003-06-05 17:47             ` Stephen Leake
2003-06-05 19:43               ` Wesley Groleau
2003-06-06  9:27               ` Georg Bauhaus
2003-06-06 10:29                 ` Preben Randhol
2003-06-03 19:38   ` Stephen Leake
  -- strict thread matches above, loose matches on Subject: below --
2003-06-04 17:00 Lionel.DRAGHI
replies disabled

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