KDE 4 namespaces

Thiago Macieira thiago at kde.org
Mon May 9 12:34:04 BST 2005


Charles Samuels wrote:
>Other annoying things about namespaces include:
>	- If you don't use "using namespace", there's a hell of a lot of typing

True.

>	- if you do use "using namespace" using a class like "ListView" is
> pretty ambiguous.

And "KListView" is a lot more telling? Sorry, not to me.

The only difference I see in K-vs-non-K is when you start talking about 
application-specific classes. If I see KMListView in KMail, I know it's a 
KMail-specific class, whereas KListView would be in the libraries.

>	- if one of the c-based header files you use has a #define ListView
> (wild example), then you'll be in for some fun trying to work around it

True, but unlikely.

> - if you use "using namespace" A person looking at a class like
> "ListView" will have no idea where the class comes from unless em is
> familiar with KDE coding.

Sorry, non-issue again. I don't think "KListView" tells you it comes from 
libkdeui anymore than "ListView" unless you're familiar with our 
libraries. Take, for example, KPixmap: pixmaps are UI, so it is in 
libkdeui, right? Wrong, it is in libkdefx.

>And I think that Thiago's different class-nestings are rather arbitrary.
>  Why does it matter if a class is part of Core or not?

I didn't understand this one.

-- 
  Thiago Macieira  -  thiago (AT) macieira (DOT) info
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

4. And æfter se scieppend ingelogode, he wrát "cenn", ac eala! se 
rihtendgesamnung andswarode "cenn: ne wát hú cennan 'eall'. Ástynt."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20050509/e58994d6/attachment.sig>


More information about the kde-core-devel mailing list