On Wednesday 2014-05-21 11:51 +1200, Robert O'Callahan wrote:
> On Wed, May 21, 2014 at 4:36 AM, Nicolas Silva <nical.si...@gmail.com>wrote:
> 
> > Honestly, I don't mean to start a bikeshed about whether we should enforce
> > strict rules about this project-wise, because I know that people have
> > different tastes as to whether writing "Size" is vastly better than
> > "gfx::Size". But I'd like to encourage people to carefully make use of this
> > c++ feature, especially when the namespace in question is used a handful of
> > times in the file. I personally will be strict about it the reviews I give.
> >
> 
> I don't think we should have rules that some reviewers enforce and others
> don't. That makes life hard for everyone.
> 
> It's not clear to me how moving the "using namespace" declaration inside a
> namespace helps. Won't most files in a unified build translation unit put
> their declarations in the same namespace, negating any benefit?
> 
> Personally I find unified-build-related using-namespace errors are rare ---
> I've not encountered one yet. I'm not sure they're worth attempting to
> ameliorate.

I wonder if the problem is that we're overusing namespaces (i.e., we
have too many of them or put many classes at places too deeply
nested in the namespace hierarchy)?  Perhaps it makes sense to have
a guideline that names shouldn't feel overly verbose with only a
"using namespace mozilla"?  For example, that would suggest that
layers::Layer feeling redundant is a sign that Layer should instead
be directly in the mozilla namespace.

I think following such a guideline (and avoiding using declarations
of the inner namespaces) might help avoiding the various collision
problems we've hit.

-David

-- 
𝄞   L. David Baron                         http://dbaron.org/   𝄂
𝄢   Mozilla                          https://www.mozilla.org/   𝄂
             Before I built a wall I'd ask to know
             What I was walling in or walling out,
             And to whom I was like to give offense.
               - Robert Frost, Mending Wall (1914)

Attachment: signature.asc
Description: Digital signature

_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to