Boost logo

Boost :

From: Stefan Slapeta (stefan_at_[hidden])
Date: 2004-02-19 06:11:09

David Abrahams wrote:

> "Peter Dimov" <pdimov_at_[hidden]> writes:
>>I would turn the question around and ask what's wrong with boost::fs (and
>>when I see boost I think std). I've never understood the rationale behind
>>long namespace names. Yes, I can alias filesystem to fs myself. But when all
>>of your users alias filesystem to fs, and you find yourself doing the same
>>in documentation, examples, tests, and in your own code, then perhaps it
>>should have been named fs in the first place.
> I was very happy typing boost::filesystem::iterator when I used it,
> and I think it only benefitted the clarity of my code.

But long namespace names encourage the use of abbreviations and many
abbreviations means many DIFFERENT abbreviations. This is surly not
beneficial for code readability!

What would be wrong about having both _as standard_?

namespace boost::filesystem {
        // ...

namespace boost::fs = boost::filesystem;

This would have some big advantages:

-) The user can choice between using the long or the short name

-) boost::fs clearly shows the origin of the type (boost).

-) The abbreviaton is standardized and can so be used consistently in
both the documentation and the code.

Anyway, I don't agree to the argument of bringing some danger with short
names in header files; boost::ref and boost::fs really don't make the
big difference!


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