comp.lang.ada
 help / color / mirror / Atom feed
From: Vinzent Hoefler <ada.rocks@jlfencey.com>
Subject: Re: Case dependence and coding standards
Date: Thu, 05 Jun 2003 09:47:09 +0200
Date: 2003-06-05T09:47:09+02:00	[thread overview]
Message-ID: <bbmskc$bc8lj$6@ID-175126.news.dfncis.de> (raw)
In-Reply-To: uisrlx0p6.fsf@nasa.gov

Stephen Leake wrote:

>Vinzent Hoefler <ada.rocks@jlfencey.com> writes:
>
>> Robert A Duff wrote:
>> 
>> >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).

Yes, because then I am the one who changes the codes willingly.

>> 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.

Well, I think, typing it right in the first place would help the
programmer, too.

>Since we rely on the compiler to
>catch type and syntax errors, why not also rely on it to catch
>capitalization errors?

Well, it *catches* them. But it shouldn't fix them.

>The goal is overall productivity; how fast I can write good code.

Well, that is a point. But I don't type in a compiler (unless someone
is crazy enough to tell the compiler to use standard input...).

OTOH, usually pure coding only takes a relatively small amount of time
of the whole development process, so the advantage of fast typing
isn't that much. If that would be, we should all take secretary
lessons to type in 10-finger-system. I never had such lesson, compared
to the usual secretary I'm typing darn slow, although I'd say, my
productivity is still good.

>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.

Well, if the IDE fixes it, this is ok. Although I wouldn't like to fix
it automatically.

Indeed, after trying out Word sometimes, I have the strong feeling
that turning on the automatic spelling correction (or whatever it is
called) actually *slowed* down by process of typing. Well, programming
languages are much more strict than the usual documentation or letters
(especially because Word doesn't know of all the technical terms I may
use), so this probably really isn't comparable.

>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.

I don't know. Never took the measurement, it's hard to measure brain
cycles. :) But sometimes I even reformat old code while reviewing and
enhance it both visually and in terms of robustness. I don't have the
feeling that it takes me longer to do so in the end.

Hmm. Ok, you're right, if it's just to make sure of a consistent
capitalization, this is usually a search and replace tasks that should
be left to the machine.

>> 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.

Ok, you're right.

The result would be the same in terms of maintainance, because the
other coders actually never see what kind of crap someone typed into
the editor before... ;)

>I'm trading brain cycles for CPU cycles, and I
>see a net gain.

Well, I agree with you, if the IDE would fix it instantly. But if I
would type

for foo in bar'range loop exit when baz<3; end loop;

or such and then trust the compiler to fix it I would have a hard time
understanding the code that I write. And I think, the more I type it
right in the first place, then it is less likely that the compiler
will complain about some stupid errors like a missing semicolon. So I
see a net gain here in less editor-compiler cycles. YMMV.

>Since I now have more brain cycles available, dirty
>hacks are less likely.

Well, my brain would be more stressed with seeing such code, lowering
the performance for the task to make the code correct in the first
place. ;)


Vinzent.

-- 
Parents strongly cautioned  --  this  posting  is  intended for mature
audiences  over  18.  It  may  contain some material that many parents
would not find suitable for children and may include intense violence,
sexual situations, coarse language and suggestive dialogue.



  parent reply	other threads:[~2003-06-05  7:47 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
2003-06-05  1:27           ` Robert I. Eachus
2003-06-05  7:47           ` Vinzent Hoefler [this message]
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