Boost logo

Boost :

Subject: Re: [boost] Name of namespace detail
From: Mateusz Loskot (mateusz_at_[hidden])
Date: 2009-10-13 04:20:11

Joel de Guzman wrote:
> Mateusz Loskot wrote:
>> Hi,
>> Inspired by Jean-Louis question about what to put to namespace detail, I
>> would be interested learning about rationale of name of the namespace
>> detail (sometimes details or impl too).
>> 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.
>> 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.
> Why? Could you please provide details on what their responses are?

The discussion was too long I think (archives are not public) but
generally the conclusion was that impl and base suffixes do not carry
much information.
For example that I put under discussion, the PIMPL-based FileReader
using Impl suffixes etc.:

class Reader
    const std::auto_ptr<ReaderBase> pimpl_;
    // ...
class ZipReaderImpl : public ReaderBase {...};
class BZipReaderImpl : public ReaderBase {...};

we came to the improved version:

class FileReader
    class Body;
    const std::auto_ptr<Body> handle;
    // ...
class ZipFileReader : public FileReader::Body {...};
class BZipFileReader : public FileReader::Body {...};

I agree that the latter is more verbose telling what is what,
and placing elements better regarding concepts it uses (handle-body).

Given that, namespace detail was judged as similarly not much
informative as Impl and Base suffix.

On the other hand, all this is based on actual convention used in a
project. If team members agree and understand what 'detail' means,
then I can't see anything wrong with using it.

Though, namespace private_ (with underscore), sounds a little bit better.

I hope it clarifies the point.

Best regards,

Mateusz Loskot,

Boost list run by bdawes at, gregod at, cpdaniel at, john at