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; };
struct X { stuff; private: other stuff; };
That's cargo cult programming. Using "class" doesn't make your code OO. The language we are programming in is C++, not OOP.
I shall proceed apace now to call
var x = 5; (function() { return x + 2; })();
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:
vs > Another reason to use "class" is because it's OOP terminology. There's no notion of "struct" in OOPThat's cargo cult programming. Using "class" doesn't make your code OO. The language we are programming in is C++, not OOP.