|
Boost : |
Subject: Re: [boost] Name of namespace detail
From: Stewart, Robert (Robert.Stewart_at_[hidden])
Date: 2009-10-13 09:11:48
Mateusz Loskot wrote:
>
> Recently, I've participated in a very interesting discussion, on ACCU
> members mailing list, about prefixes and suffixes like Base
> or _base nad
> Impl or _impl, as misused, irrelevant and confusing, meaningless, etc.
> For example, how to properly name elements of PIMPL idiom and similar.
As has been noted, if a class is a private, implementation detail, then some naming convention for that purpose is useful. I've seen "IC" used as a prefix to mean "implementation class." I've seen "Impl" or "_impl" as a suffix for the same purpose. These names indicate that they are not for library client use, even if they happen to be visible.
> During the discussion I suggested that 'detail' is a good name for
> namespace dedicated to implementation details being not a
> part of public
> interface of a component. I got answer that it as the same
> issues (it's
> meaningless) as Impl etc.
While I've never been comfortable with "detail" and greatly prefer "details," the point is that it is a namespace, nested within another, more meaningfully named namespace, that holds implementation details that should be ignored by those using the enclosing namespace. There's no need for a name with any more meaning than that in many cases.
However, it is quite reasonable to nest other namespaces within detail(s) in order to segregate details, all related to the outer namespace, by purpose. That is, if there are too many unrelated implementation details in the foo::details namespace, then foo::details should be subdivided.
> It raised some questions for myself, being interested in improving my
> craft, I would like to learn better about the name of
> namespace detail.
> I use detail name myself. Any better names for bucket with
> implementation details?
Any time there is value in grouping things by a categorical name, do so. However, when those are implementation details of something else that should be visible to clients, then those details should be in a namespace like "details" to set them apart.
_____
Rob Stewart robert.stewart_at_[hidden]
Software Engineer, Core Software using std::disclaimer;
Susquehanna International Group, LLP http://www.sig.com
IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk