Hi, Roger Scudder!
On 12 Sep 97 15:25:00 you wrote to Kurt Kuzba
KK> class MathCalc
KK> {
KK> private:
KK> int iVar1, iVar2, iResult;
RS> Why do you code the private keyword when the data is private
RS> by default. Is this considered good style?
I don't know what is considered, but I generally code that too. It's more
intuitive to me reading back the code, and make the maintainance easier too.
Somtime you have to move the data members between public/prot/priv sections,
or reorder the sections themselves. If you later find more convenient to see
those vars above at the bottom of the class deffinitions, you imply select
and move it. If you omitted the private: you will have to type it in later.
If you have several comment lines at the beginning of the class (and sure you
have them, that is not that simple to keep in mind, some variables you see
are private just 'cos they are at the beginning.
A fat class will commonly have a dozen of such labels, so why omit that one
at the very start.
Paul
... Gentlemen: Start your debuggers...
--- OS/2 Warp
---------------
* Origin: The FlintStones' Cave in BedRock (2:371/20)
|