<div dir="ltr">There was some discussion in IRC, but I wanted to make sure people who read the maillist also got a chance to weigh in.<div><br></div><div><a href="https://gerrit.openbmc-project.xyz/c/openbmc/docs/+/14712">https://gerrit.openbmc-project.xyz/c/openbmc/docs/+/14712</a><br></div><div><br></div><div>This is a proposal to adjust the language of our C++ Style Guide to allow repo maintainers to require or encourage prefixes based on variable scope:<br><br>```<br>constexpr int gValue;<br><br>class Foo {<br>  private:<br>    bool mFlag;<br>  public:<br>    void Bar() {<br>      int thing;<br>      if (mFlag && gValue < 0) {<br>        thing++;<br>      }</div><div>    }</div><div>}<br>```</div><div><br></div><div>The great thing about this is that you have a much stronger guarantee that you won't end up with shadowed variables - it becomes almost impossible to name your local in a way that collides with a larger-scoped variable you forgot about.</div><div><br></div><div>That said, there's some question about how and whether to standardize across all of OpenBMC. Renaming variables in all our repos would be a big effort, and some maintainers might prefer different prefixes than others - for example, canonical indicators for member variable include mFooBar, m_fooBar, _fooBar, fooBar_,....</div><div><br></div><div>If you've got some strong opinions on the subject, come weigh in and help us figure out the right language.</div><div><br></div><div>Personally, I just want the language to allow me to start enforcing prefixes in repos I comaintain, without being overly prescriptive; if you've got a different opinion or a better idea of phrasing, I wanna hear it.</div><div><br></div><div>Emily</div></div>