Skip to content

please use 'protected', not 'private' in C++ classes #2440

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bombasticbob opened this issue Nov 12, 2014 · 4 comments
Closed

please use 'protected', not 'private' in C++ classes #2440

bombasticbob opened this issue Nov 12, 2014 · 4 comments
Labels
Type: Duplicate Another item already exists for this topic

Comments

@bombasticbob
Copy link

use of 'private' in C++ classes makes it very difficult to create a derived class that's capable of providing functionality that extends the original, without actually cloning the code yourself to 'make it work anyway'. In my view, 'private' is an outdated and short-sighted concept anyway, particularly with open source. Using 'protected' accomplishes the same thing without tying anyone's hands. It's a simple edit to change all of the 'private' members to 'protected'.

@NicoHood
Copy link
Contributor

In my opinion i'd say this makes a lot of sense. Good idea!

@NicoHood
Copy link
Contributor

#1627

@cmaglie
Copy link
Member

cmaglie commented Nov 20, 2014

Closing as duplicate of #1627

@cmaglie cmaglie closed this as completed Nov 20, 2014
@cmaglie cmaglie added the Type: Duplicate Another item already exists for this topic label Nov 20, 2014
@bombasticbob
Copy link
Author

heh I wrote the same thing a year ago. It was a gripe then, still is now. I forgot I'd done it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Duplicate Another item already exists for this topic
Projects
None yet
Development

No branches or pull requests

3 participants