4 ms·
> you should always prefer private to protected and protected to public It's well known that protected is not any safer than public. Anybody can inherit and us
by nicolasgz 13y ago
> you should always prefer private to protected and protected to public
It's well known that protected is not any safer than public. Anybody can inherit and use it.
You can still make members private in structs. It's only less redundant:
class X { public: stuff; private: other stuff; };
vs
struct X { stuff; private: other stuff; };
> Another reason to use "class" is because it's OOP terminology. There's no notion of "struct" in OOP
That's cargo cult programming. Using "class" doesn't make your code OO. The language we are programming in is C++, not OOP.
- eropple 13y ago> That's cargo cult programming. Using "class" doesn't make your code OO. I shall proceed apace now to call var x = 5; (function() { return x + 2; })(); a glarfblork instead of a lambda, then, if semantics of naming should just be pitched out a window.