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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,997e6472f58cc955 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-06-05 00:48:30 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!fu-berlin.de!uni-berlin.de!213.200.246.247!not-for-mail From: Vinzent Hoefler Newsgroups: comp.lang.ada Subject: Re: Case dependence and coding standards Date: Thu, 05 Jun 2003 09:47:09 +0200 Organization: JeLlyFish software Message-ID: References: <035odv8mfiksmqo69q0250qp141oebtdro@4ax.com> NNTP-Posting-Host: 213.200.246.247 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: fu-berlin.de 1054799308 11936435 213.200.246.247 (16 [175126]) X-Newsreader: Forte Agent 1.8/32.548 Xref: archiver1.google.com comp.lang.ada:38663 Date: 2003-06-05T09:47:09+02:00 List-Id: Stephen Leake wrote: >Vinzent Hoefler writes: > >> Robert A Duff wrote: >>=20 >> >I like to turn on the GNAT switch that complains when I say "Text_io" >> >instead of "Text_IO". >>=20 >> 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. --=20 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.