Boost logo

Boost-Build :

From: Ryan Gallagher (ryan.gallagher_at_[hidden])
Date: 2006-05-17 15:01:22


Vladimir Prus <ghost <at> cs.msu.su> writes:
>
> First of all, why do you have identically named files in subdirectories? For
> now, I don't understand why this is a such a recurring problem for users --
> we had several reports already.

Hi Volodya,

Your question had been asked on a separate thread, and I get the
feeling that it's a hint that this is bad practice, but I have yet to hear
a decent argument for that. Let me explain my personal reasons, which I
believe match with some other users.

C++ allows you to separate your code by namespaces. Like Boost code,
our directory layout often matches that of the namespace. Further
our filenames often match that of our class names.

I believe that this is all considered good practice in general. The
questionable practice may be in having the same class name in multiple
namespaces within the same project. Personally, I believe that this is
hogwash because otherwise I feel that it implies only having one real namespace
per project, but I can understand if others disagree. I'm open to discussion
on this topic but generally the response I've heard in personal conversations
amounts to the objector not being comfortable with their development tools.
(Another possible argument against this approach would probably be concerning
the choice of namespaces and general project organization; but this seems
less tangible and not one that I've heard in practice.)

What I do not understand is why a build system should dictate to us the
practices we should follow. If it is trying to help users avoid a bad design
then this conscience decision should be well documented and open to
discussion.

My concern is simply that currently bbv2 does not seem to have a matching
concept for namespaces. I would love to discuss the design question on a
different list, but as far as the topic of this list goes, I believe that
this concern should be all that matters.

> Implementation-wise, here are my thoughts:
>
> 1. For a Jamfile with a single source location, we can, for all source files
> below that source location, retain the relative path, no problem.

This is what I am requesting.

> 2. For a Jamfile with several source locations, it's not clear what do to.
> Say, /foo/src and /bar/src are source locations for one Jamroot, and there
> are both /foo/src/class.cpp and /bar/src/class.cpp. In this case, we'd need
> to get those "foo/src" and "bar/src" to the target path?

Going to concepts, you've essentially imported or "using namespace" two
namespaces containing the same name, which when used would result in an
ambiguity in any other language. IMHO, BBv2 should still report an ambiguity
as it does today.

Thanks for responding and looking at this Volodya.

> - Volodya
-Ryan


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk