Boost logo

Boost :

Subject: Re: [boost] [TTI] Review
From: Edward Diener (eldiener_at_[hidden])
Date: 2011-07-11 12:32:06


On 7/11/2011 10:56 AM, Stewart, Robert wrote:
> Edward Diener wrote:
>> On 7/10/2011 7:59 PM, Lorenzo Caminiti wrote:
>>> Review of Boost.TTI 2011-07-10 (Lorenzo Caminiti)
>>
>>> 10. [NOTE] I think "member variable" is a more accepted name
>>> that "member data"-- isn't it? If so, I'd rename MEMBER_DATA
>>> to MEMBER_VARIABLE.
>>
>> I can understand your preference. I will consider it.
>
> They are called data members, not member variables, in C++. Names like "member variable" come from other languages.
>
> I don't use "member data" generally, but to me it describes data members collectively, not singularly.
>
> I recognize the desire to keep the prefixes alike, but I'd rather see "HAS_DATA_MEMBER" to be consistent with Standard terminology.

I agree with your remark about the normal terminology. I could have used
HAS_DATA_MEMBER and HAS_MEMBER_FUNCTION but I wanted to align the names
around a common beginning. That is why I chose HAS_MEMBER_DATA and
HAS_MEMBER_FUNCTION. Similarly HAS_STATIC_MEMBER_DATA and
HAS_STATIC_MEMBER_FUNCTION. Sometimes such mnemonic similarities (
having the same common beginnings ) is more important than other factors.

I know that this may start some long discussion about names in TTI, but
here is a general suggestion to all programmers who are ever upset about
names in a library, and does not just refer to TTI: if you do not like a
name, just create an object-like macro for your own use which takes some
name and transforms it to some other name which you like better.

Lorenzo might write the macro:

#define BOOST_TTI_HAS_MEMBER_VARIABLE BOOST_TTI_HAS_MEMBER_DATA

and you might write the macro:

#define BOOST_TTI_HAS_DATA_MEMBER BOOST_TTI_HAS_MEMBER_DATA

This is guaranteed to work without problems all the time AFAIK to
transform one name to another.

Eddie


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk