Skip to content

Fix the wording "counter example" #129

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pieterhijma
Copy link
Contributor

Make a small fix in reaction to this feedback by @benj5378.

@hyarion
Copy link
Contributor

hyarion commented May 2, 2025

I think we could make it more clear what is good and what is bad.
Maybe we could do something in the same style as the core guidelines (example from https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#f16-for-in-parameters-pass-cheaply-copied-types-by-value-and-others-by-reference-to-const):

void f1(const string& s);  // OK: pass by reference to const; always cheap

void f2(string s);         // bad: potentially expensive

void f3(int x);            // OK: Unbeatable

void f4(const int& x);     // bad: overhead on access in f4()

in this case it could look like:

auto value = randomThing.weirdProperty->getValue(); // bad: non-obvious type

long value = randomThing.weirdProperty->getValue(); // OK: type is specified, no need to guess type

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

Successfully merging this pull request may close these issues.

3 participants