Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> 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.



> 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: