Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #11918

Re: Equates or Synonyms?

From Ian Collins <ian-news@hotmail.com>
Newsgroups comp.lang.c++
Subject Re: Equates or Synonyms?
Date 2011-11-29 12:52 +1300
Message-ID <9jil6iF570U1@mid.individual.net> (permalink)
References <MPG.293c70af3b85a5c09896d0@news.eternal-september.org> <jauosu$efo$1@dont-email.me> <MPG.293cb9d8c4425bd79896d1@news.eternal-september.org> <9jghddF4d0U23@mid.individual.net> <MPG.293dc12863cb15909896d3@news.eternal-september.org>

Show all headers | View raw


On 11/29/11 12:03 PM, Mike Copeland wrote:
>>>>> capability to "equate" or use a synonym for
>>>>> an identifier?
>>>>>    I have the following declaration:
>>>>> struct DEF_STRUCT
>>>>> {
>>>>>        int      EPace;               // event maximum pace
>>>>>        int      TFCount;             // Total Finishers Counts
>>>>>        short    ADepth;              // Awards Depth
>>>>>        short    SFMales, SFFemales;  // Skipped Finishers
>>>>>        unsigned short dbeMales, dbeFemales;
>>>>>        unsigned short finMales, finFemales;
>>>>>        unsigned short prtMales, prtFemales;
>>>>>        float    EDist;               // event distance in miles
>>>>> [etc.]
>>>>> } ;
>>>>> and I'd like to "reuse" some of the names (such as EPace or ADepth) with
>>>>> different identifiers.  That is, in some of my programs where I have
>>>>> this structure declared I'd like to use a different name for, say,
>>>>> EPace, because I'm not actually using that data element in that
>>>>> particular application.
>>>
>>>> Why do you want a different name when you're not using it?
>>>> The simplest solution is then to ignore the name.
>>>> After all, you're not using it.
>>>
>>>      I only want to use a more descriptive name for the variable in the
>>> application code.  I want to maintain _some_ level of useful
>>> documentation in my code...
>>
>> Then don't bother with the name of type, just give the variable a better
>> name.  Try "eventMaximumPace" rather than "EPace".  Also heed Alf's
>> advice about mixing naming convections!
>
>     That's one reason why I want this capability: I know the name isn't
> "good", but I have any applications where it's in my code but I want to
> gradually migrate to the better name.  Some of these applications are
> old and don't need updates right now, so I'd leave them alone for a
> while while I work on current stuff...

Being somewhat lazy these days, I'd just load up the projects in my 
current IDE and select refactor->rename.  Job done.

-- 
Ian Collins

Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Equates or Synonyms? mrc2323@cox.net (Mike Copeland) - 2011-11-27 16:07 -0700
  Re: Equates or Synonyms? Ian Collins <ian-news@hotmail.com> - 2011-11-28 12:50 +1300
    Re: Equates or Synonyms? mrc2323@cox.net (Mike Copeland) - 2011-11-27 21:21 -0700
  Re: Equates or Synonyms? "Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com> - 2011-11-28 02:41 +0100
    Re: Equates or Synonyms? mrc2323@cox.net (Mike Copeland) - 2011-11-27 21:19 -0700
      Re: Equates or Synonyms? Ian Collins <ian-news@hotmail.com> - 2011-11-28 17:35 +1300
        Re: Equates or Synonyms? mrc2323@cox.net (Mike Copeland) - 2011-11-28 16:03 -0700
          Re: Equates or Synonyms? Ian Collins <ian-news@hotmail.com> - 2011-11-29 12:52 +1300
            Re: Equates or Synonyms? mrc2323@cox.net (Mike Copeland) - 2011-11-28 22:00 -0700
              Re: Equates or Synonyms? Ian Collins <ian-news@hotmail.com> - 2011-11-29 18:13 +1300
              Re: Equates or Synonyms? ralph <nt_consulting64@yahoo.net> - 2011-11-28 23:21 -0600
              Re: Equates or Synonyms? Jorgen Grahn <grahn+nntp@snipabacken.se> - 2011-11-29 12:10 +0000
      Re: Equates or Synonyms? Paavo Helde <myfirstname@osa.pri.ee> - 2011-11-28 01:40 -0600
      Re: Equates or Synonyms? Stuart Redmann <DerTopper@web.de> - 2011-11-28 02:38 -0800
    Re: Equates or Synonyms? Jorgen Grahn <grahn+nntp@snipabacken.se> - 2011-11-28 13:24 +0000
  Re: Equates or Synonyms? "Paul" <pchrist<nospam>or@yahoo.co.uk> - 2011-11-28 19:21 +0000
    Re: Equates or Synonyms? mrc2323@cox.net (Mike Copeland) - 2011-11-28 16:14 -0700
      Re: Equates or Synonyms? Kalle Olavi Niemitalo <kon@iki.fi> - 2011-11-29 09:01 +0200

csiph-web