Posted by Richard Levasseur on 02/19/06 07:43
It is good programming practice to declare all the class and object
members at the start. That way, when you or someone else goes back to
modify it 6 months later you have a better idea of what is going on.
Secondly, if you were to receive an arbitrary object of that type, you
know what is available to use without having to rely on some technique
to tell you what was set/not-set during the course of the objects
lifetime.
If you have a lot of variables in a class, but are only using a few at
a time, then you may want to reconsider the object and the breakdown of
them.
[Back to original message]
|