Skip to content
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

C.131: Avoid trivial getters and setters - a request for clarification #1178

Open
RobertEBrown opened this issue Mar 27, 2018 · 1 comment
Open
Assignees

Comments

@RobertEBrown
Copy link

I realize that this is a controversial item and that there are already a few inconclusive discussions about it, but I hope that my question may have a clear answer.

Basically, I would like it clarified whether the intended reading of this guideline is

Avoid pairs of trivial getters and trivial setters

or

Avoid trivial getters and avoid trivial setters

and if it's the latter, why?

It seems to me that it is perfectly reasonable to have a trivial getter if the setter is non-trivial (or not present). This does not appear to contradict the reasoning in the item in any way. I'm even thinking that maybe the most direct way to communicate the intent would be

Avoid trivial setters

wouldn't it?

@hsutter
Copy link
Contributor

hsutter commented Apr 9, 2018

We mean primarily the former and will clarify and add examples.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants