On 5/20/2014 8:37 PM, Ehsan Akhgari wrote:
FWIW, I argued against nested namespaces a few years ago (couldn't find a link to it through Google unfortunately) and people let me "win" that battle by allowing me to edit the coding style to prohibit nested namespoaces in most cases <https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style#Namespaces>, but unfortunately we never adhered to this rule in practice, and these days three level nested namespaces are pretty common in the code base. We're just bending C++ in a way that it's not quite comfortable with here.

How about adding the rule "all new namespaces must be approved by <insert specific top-level superreviewer here>", just like all new top-level directories need to be explicitly approved? If we could get reviewers to enforce that, it would hopefully cut down on people using outlandishly long namespaces.

I think there are valid reasons to have a two-level namespace (e.g., mozilla::mailnews [1]), but I find it deathly hard to justify going any deeper.

[1] Actually, I would probably prefer mozilla::comm had mozilla::mailnews not already had precedent when I started using C++ namespaces. :-)

--
Joshua Cranmer
Thunderbird and DXR developer
Source code archæologist

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

Reply via email to