Namespaces in libkdecore

Scott Wheeler wheeler at kde.org
Sat May 1 20:41:12 BST 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Saturday 01 May 2004 20:49, Matthias Ettrich wrote:

> Nothing is clean if we assume that people use 'using' anyway.

I'm actually not strongly biased on this for our main usage.  However if we do 
go the compatibility lib route I see it as a convenience that would allow us 
(where logical) reuse class names.  i.e. KLineEdit and KDE3::KLineEdit (Not 
that I expect much to change there, but just using that as an example.)

> With regards  
> to versioning: think about how you would really make use of this. Take 
> libraries into account, the fact that ELF already has a version number 
> associated with a shared object file, source and binary compatibility and 
> code with 'using' directives.

I assumed this was referring to the case above -- it makes it fairly easy to 
partition things off for use in backwards compatibility.

> Also take readability into account. Even if  
> the namespace is only  KDE, KDE::LineEdit is a lot harder to work with than 
> KLineEdit (and it makes the code look ugly).

Well, that's subjective.  Once you're used to working with namespaces (which I 
do in some of my non-KDE code) using "K" as a namespace instead of using the 
language's facilities for such looks ugly...

> Forcing people to add 'using' in every cpp-file, and KDE::FOO::BAR to every 
> headerfile is a rather big change, it shouldn't be done without good reasons 
> and use-cases that describe how we would benefit from the change in the 
> future. "cleaner" is a weak argument for putting additional burden on 
> application developers, whereas "easier" would be a strong argument. Having 
> said this, "..." is a rather unspecific argument, so I don't know whether 
> it's strong or weak :)

Again, I'm not strongly biased, but much of the newer stuff in KDE is using 
namespaces.  I'd prefer that we standardize one way or the other though -- I 
don't particularly like having a minority of KDE using something other than 
our "standard" convention.

- -Scott

- -- 
Anyone who has begun to think, places some portion of the world in jeopardy.
- -John Dewey
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQFAk/1YQu0ByfY5QTkRAuddAKCxAYygoVwOQbOkDhBo/3tYl7ahSgCfaVvl
e1FkM9pW2Ls2n5ej3801NPI=
=4ex+
-----END PGP SIGNATURE-----




More information about the kde-core-devel mailing list