[llvm-dev] Variable names rule

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Mon Feb 4 12:16:34 PST 2019

On Mon, 4 Feb 2019 at 20:03, JD Jones <jjones at prc-hsv.com> wrote:
> Sorry, I'm not sure I follow.

In conventional English usage, acronyms always use upper-case. All
other coding conventions deal with that situation gracefully (or at
least not terribly). If someone strictly follows the coding convention
you might end up with a weird identifier (m_tlaThatDoesSomething,
m_tLAThatDoesSomething, ...); if they favour English over coding you
get (m_TLAThatDoesSomething).

The leading underscore is unique in turning that last case into
something that violates the language standard, and for me that's
enough to eliminate it from contention. I strongly discourage its use
in any C or C++ project.


More information about the llvm-dev mailing list