[Tutor] A new comer
alan.gauld@bt.com
alan.gauld@bt.com
Sat, 9 Mar 2002 21:31:08 -0000
> the other big thing that catches people is in C++ the
> variable *this is implicit and you almost never see it.
Hmm, in my (limited(*)) experience most industrial IT departments
have coding guidlines that insist you use this-> in front of
every class member/method to make it obvious that its a class
thing and not a local function name.
eg:
class foo{
private:
int x,y;
public:
doit(int p)
{
int z = 0;
z = p + this->y;
return this->x/this->y;
}
};
So using self is only a minor hiccup.
use of unreferenced members is one of the most confusing
features of C++ programs to a maintenance progammer, and
a bigger source of frustration that anything else when
dealing with deep class heirarchies!
Alan g.
(*)I've only seen 3 different company C++ standards!