[Qt-creator] Use of namespaces in Qt Creator's own code
André Pönitz
andre.poenitz at mathematik.tu-chemnitz.de
Tue Jul 9 23:54:18 CEST 2013
On Tue, Jul 09, 2013 at 01:00:20PM +0200, Christian Kandeler wrote:
> On 07/09/2013 11:11 AM, Oswald Buddenhagen wrote:
> > to solve the clash problem, there are two approaches:
> > - use an additional convention (ugly)
> > - FooNames::Foo
> > - Foo::FooClass
> > - remove the redundancy
> > - Foo::Plugin
>
> Definitely the latter. In general, I've come to resent this "double
> namespacing" that we do in a lot of places in Qt Creator (I am very much
> guilty of it too). It's probably a combination of mistrusting the C++
> language and excessive use of using directives. How about discouraging
> that for new plugins in the coding conventions?
The 'clash' case is really 'BinEditor' (plugin) vs 'BinEditor' (the actual
class implementing the IEditor interface), and it's solvable without
renamings. So "it's ok right now".
The question is whether changes would improve the gneral setup. "git grep
'\bInternal\b' | wc -l" currently comes up with 16592, so having the
'Internal' namespaces definitely adds line noise to the code base.
Line noise is a kind of cost, changing things without reason also inflicts
cost. I generally like to see "costs" being compensated by "benefits", and
I am trying to find out where people think the blance is. Quotes around
both words are intentional -- not much here can be measured objectively.
If there's no clear tendency in the discussion "keeping it as it is" is
definitely a viable solution. I just want to make sure we are not missing
"obviously needed" changes before tightening the rules on compatibilty.
Andre'
More information about the Qt-creator
mailing list