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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d1df6bc3799debed X-Google-Attributes: gid103376,public From: kaz@vision.crest.nt.com (Kaz Kylheku) Subject: Re: Not intended for use in medical, Date: 1997/05/15 Message-ID: <5lebcu$3cp@bcrkh13.bnr.ca>#1/1 X-Deja-AN: 241645332 References: <3.0.32.19970423164855.00746db8@mail.4dcomm.com> <5ktldo$2pp@bcrkh13.bnr.ca> <01bc5ff7$22677e60$LocalHost@xhv46.dial.pipex.com> Organization: Prism Systems Inc. Newsgroups: comp.lang.ada Date: 1997-05-15T00:00:00+00:00 List-Id: In article <01bc5ff7$22677e60$LocalHost@xhv46.dial.pipex.com>, Nick Roberts wrote: > > >Kaz Kylheku wrote in article ><5ktldo$2pp@bcrkh13.bnr.ca> an example of the use of short identifiers in >some C code. > >I think Kaz' example illustrates quite neatly that there are places where a >short identifier is appropriate. Remember, the Ada 95 standard defines the It's not like I started doing this yesterday, after all. And it's not like there aren't any long_identifier_names in the routine, like make_external_cblock and apply_sbox. I will grant you that cblock is a little cryptic, since it's short for cipherblock. I think I copied the contraction from Eric Young's LibDES interface, which defines the type des_cblock. >constants 'Pi' and 'e' in Ada.Numerics, and these can hardly be cited as >examples of long identifiers! And yet, they are highly appropriate, are >they not? I am not impressed by programmers who get religious about these >things. > >Having said that, I would caution against the use of single-letter >identifiers where possible, for the extremely pragmatic reason that trying >to do a search-and-replace on them (e.g. to change all occurrences of >variable 'a' to 'x') a minefield. It's almost always easy to use two It's not bad with decent regex syntax. In the vi compatible editor I use, matching x as an identifier would be done as \. Those little doodads that surround the x anchor the search to the beginning and end of a delimited word, respectively. To be safe, I'd search for it ``manually'', like this /\. Upon hitting the first occurence I'd edit it to 'a' by typing 'ra'. Then I'd just hit 'n' for the next search and '.' to repeat the edit. n.n.n.n.n.n. Really quick and surgical. Or I'd do it automatically, but restrict the range of code (subranges are useful safety features in editing too :)) I could rename identifiers all day just for the sheer pleasure of the vi. :) >generally makes search-and-replace much less dangerous. If I could have a >penny for every time I've fallen foul of that one ... ;-) ...you might save up for some ice cream, because good editors often come in freeware form these days! >Nick. >(See - I have a short identifier) It's a short nick, indeed.