D pointers

George Staikos staikos at kde.org
Mon Oct 3 17:11:36 BST 2005


On Monday 03 October 2005 05:47, Simon Hausmann wrote:
> The problem I see with leaving unused variables around in classes is that
> the compiler doesn't warn you when you accidentially use them. Usually not
> initialized anymore then you're quickly in trouble when you write mVariable
> instead of d->newVariable.

   That's easy to deal with.  Either replace them with filler or rename them 
to "dont_use_this_[0-9]+".

> Besides that it probably doesn't hurt for integers and other primitive
> types, but if you have more complex types you still waste constructor and
> destructor time on them even if they're unused.

   You can replace them with POD filler.

-- 
George Staikos
KDE Developer				http://www.kde.org/
Staikos Computing Services Inc.		http://www.staikos.net/




More information about the kde-core-devel mailing list