[RFC] Solid and use of namespaces

Thomas Zander zander at kde.org
Mon May 22 15:15:16 BST 2006


On Monday 22 May 2006 15:39, Marcos Mayorga wrote:
> > Seems to me you're confusing namespaces and polymorphism.
>
> i don't think so, because in my example i solar_panel doesn't inherit
> from battery, just reside in the same namespace, ok, power::have_i...
> function would use polymorphism to resolve which class to use, but my
> point was that all of these classes resides inside power namespace.

Then your only example of how it is better has nothing to do with 
namespaces and I already gave some examples (which David also agreed 
with) where readability is actually hampered. I.e. its not so black and 
white.

Nobody is saying namespaces are evil; its all a matter of weighing the 
good and the bad.  And if you overuse namespaces (i.e have more then one 
namespace for any library) then the small amount of good points that 
namespaces bring will quickly be overshadowed by the readability, 
learnability and feeling of having an overdesigned API.

-- 
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/20060522/5dbc1a5f/attachment.sig>


More information about the kde-core-devel mailing list