Re: using namespace

2014-05-21 Thread Ehsan Akhgari
On 2014-05-21, 7:40 AM, Nicolas Silva wrote: Sorry, my example was not clear enough. The issue with using namespace + unifoed builds is that the using namespace declaration applies to all (or most) of the headers included in the unified translation unit. So using namespace mozilla at the top of e

Re: using namespace

2014-05-21 Thread Nicolas Silva
Sorry, my example was not clear enough. The issue with using namespace + unifoed builds is that the using namespace declaration applies to all (or most) of the headers included in the unified translation unit. So using namespace mozilla at the top of each .cpp is harmless until we include third par

Re: using namespace

2014-05-20 Thread Ehsan Akhgari
On 2014-05-20, 10:00 PM, Joshua Cranmer 🐧 wrote: 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 n

Re: using namespace

2014-05-20 Thread Joshua Cranmer 🐧
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

Re: using namespace

2014-05-20 Thread Robert O'Callahan
On Wed, May 21, 2014 at 1:11 PM, L. David Baron wrote: > 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 f

Re: using namespace

2014-05-20 Thread Ehsan Akhgari
On 2014-05-20, 9:11 PM, L. David Baron wrote: On Wednesday 2014-05-21 11:51 +1200, Robert O'Callahan wrote: On Wed, May 21, 2014 at 4:36 AM, Nicolas Silva 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

Re: using namespace

2014-05-20 Thread L. David Baron
On Wednesday 2014-05-21 11:51 +1200, Robert O'Callahan wrote: > On Wed, May 21, 2014 at 4:36 AM, Nicolas Silva 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 t

Re: using namespace

2014-05-20 Thread Brian Birtles
(2014/05/21 8:51), Robert O'Callahan wrote: 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 wasted half a day recently due to a "using namespace mozilla::layers" in an unrelated fil

Re: using namespace

2014-05-20 Thread Robert O'Callahan
On Wed, May 21, 2014 at 4:36 AM, Nicolas Silva 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 li

Re: using namespace

2014-05-20 Thread Benjamin Smedberg
On 5/20/2014 12:36 PM, Nicolas Silva wrote: So, I strongly encourage everyone to stop using "using namespace". I think I disagree about the "mozilla" namespace specifically. Since basically all of gecko does or will end up being in the mozilla namespace, I'd like to counter-propose that we s

Re: using namespace

2014-05-20 Thread Boris Zbarsky
On 5/20/14, 2:23 PM, Bobby Holley wrote: In XPConnect, we have "using namespace JS" everywhere. This is pretty important, because the JS rooting/handle API is very cumbersome to use otherwise. Note that if every file in a directory has the same "using namespace" declarations, then there is no

Re: using namespace

2014-05-20 Thread Jonas Sicking
On Tue, May 20, 2014 at 9:36 AM, Nicolas Silva wrote: > Now that we have unified builds, writing "using namespace" in the global > scope of a .cpp file is almost as bad as writing it in a header. Regularly > build errors show up like this one: > https://tbpl.mozilla.org/php/getParsedLog.php?id=400

Re: using namespace

2014-05-20 Thread Bobby Holley
In XPConnect, we have "using namespace JS" everywhere. This is pretty important, because the JS rooting/handle API is very cumbersome to use otherwise. ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-pla