|
Boost : |
Subject: Re: [boost] [TTI] Review for The Type Traits Introspection library by Edward Diener **extended**
From: Jeffrey Lee Hellrung, Jr. (jeffrey.hellrung_at_[hidden])
Date: 2011-07-18 13:34:15
On Sun, Jul 17, 2011 at 3:18 PM, Edward Diener <eldiener_at_[hidden]>wrote:
> On 7/17/2011 4:15 PM, Jeffrey Lee Hellrung, Jr. wrote:
>
>> On Sun, Jul 17, 2011 at 12:35 PM, Edward Diener<eldiener_at_[hidden]**
>> >wrote:
>>
>> On 7/17/2011 2:22 PM, Jeffrey Lee Hellrung, Jr. wrote:
>>>
>>> Well, if the naming scheme is simple (I think it is), I don't think we
>>>> have
>>>> to worry about the metafunction provider nor the metafunction user not
>>>> understanding the naming scheme. Have users been requesting these GEN
>>>> macros? Are the GEN macros targeted toward the metafunction provider
>>>> (who
>>>> should know what identifiers he's injecting into the namespace) or the
>>>> metafunction user (who will need to read documentation either way to get
>>>> the
>>>> name of the metafunction)? I don't really see the point, and I now
>>>> refer
>>>> you to my comment about "less is more" at the top.
>>>>
>>>>
>>> The GEN macros are targeted at the metafunction user. If people really
>>> feel
>>> it is easier reading the documentation and looking at the way that
>>> metafunction names are generated than to just repeat the metafunction
>>> macro,
>>> add _GEN to the end, and pass it element name to automatically generate
>>> the
>>> metafunction name, I may remove the GEN macros. I still think that using
>>> the
>>> equivalent GEN macro for each metafunction macro is a nice and easy way
>>> to
>>> get the refer to the name of the metafunction for each metafunction
>>> macro.
>>>
>>>
>> They'd have to read the documentation to figure out how to use the GEN
>> macros, too :) Also "reading the documentation and looking at the way
>> that
>> metafunction names are generated" is 13 words worth work, while "repeat
>> the
>> metafunction macro, add _GEN to the end, and pass it element name to
>> automatically generate the metafunction name" is 20 words worth work, so
>> the
>> former is by far easier than the latter :)
>>
>
> I thought it would be easier, given let's say macro
>
> BOOST_TTI_HAS_STATIC_MEMBER_**FUNCTION(name),
>
> to refer to the metafunction name as
>
> BOOST_TTI_HAS_STATIC_MEMBER_**FUNCTION_GEN(name)
>
> than to remember it is:
>
> 'has_static_member_function_**name'.
>
> I admit I can be wrong about this but I really, really do not see what harm
> those GEN macros can cause for those who want to use them instead.
>
If the GEN macros are primarily for the metafunction *users*, you're really
taking up the burden that should be carried by the metafunction
*providers*. It would be the metafunction provider's job to ensure their
users know their API. The metafunction user may not even know or care about
the existence of the TTI library (they should, of course, but I think it's a
reasonable possibility).
And, sorry, I don't see how one is easier to remember than the other :/
Just take the part of the macro after BOOST_TTI_, lowercase it, and append
_'name'. I mean, I thought one of the points about the automatic name
generation is so people *don't* have to think about the name of the
metafunction...
You're giving users 2 different ways to do the same thing. One way you
don't really have any choice to give (the user can just use the name of the
metafunction directly), and I just don't see the other (the GEN macros)
offering any compelling advantages. I think this is laying the groundwork
for confusion.
- Jeff
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk