[RFC] Solid and use of namespaces

Thomas Zander zander at kde.org
Sun May 21 17:19:19 BST 2006


On Sunday 21 May 2006 16:50, David Faure wrote:
> > I mostly fail to see the need for namespaces, it feels like
> > overdesign without any clear advantage, since C++ does not provide
> > many features in the user of namespaces.
> > And if the advantage is Power::Manager instead of PowerManager and
> > Power::Battery::isFilled() instead of PowertypeBattery::isFilled(),
> > well; its too similar to actually accept disadvantages in my
> > experience.
>
> The difference is that in a .cpp file you can do
> using namespace Power;
> Manager(...); Battery::isFilled();
> etc.
> which avoids filling the file with "Power" everywhere.

Oh, sorry for not being clear; I am aware of that, indeed. In the part I 
wrote above I meant to say that I'd rather have 'PowerManager' and  
'PowertypeBattery' in my sources then the ones you have.
I firmly believe that using namespaces to such an extreme will hinder 
readability of the sources.

So, while it indeed is less to type and may make it easier to write, that 
is of secondairy importance in open source due to the fact that people 
will read sources many times but only write them ones or twice.

-- 
Thomas Zander
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20060521/40dc9767/attachment.sig>


More information about the kde-core-devel mailing list