Skip to content

Commit 32d8aab

Browse files
committed
Clarify naming of underscores vs drake's math caps
1 parent 9c17262 commit 32d8aab

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

cppguide.html

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4748,12 +4748,15 @@ <h3 id="General_Naming_Rules">General Naming Rules</h3>
47484748
variable names</a>.</p>
47494749

47504750
<p class="exception drake">
4751-
Method names may violate both the name structure standard and the “long,
4752-
human-readable” standard above if a short, non-compliant name more closely
4753-
matches the common conventions of the field. For instance, the matrix
4754-
portion of a linear complementarity constraint is traditionally ‘M’ (one
4755-
letter, upper-case); it is not mandatory to downcase it or give it a more
4756-
verbose name.
4751+
Variable and method names may violate both the capitalization standard and
4752+
the “long, human-readable” standard above if a short, non-compliant name
4753+
more closely matches the common conventions of the field. For instance, the
4754+
matrix portion of a linear complementarity constraint is traditionally ‘M’
4755+
(one letter, upper-case); it is not mandatory to downcase it or give it a
4756+
more verbose name. However, even if a variable name is capitalized to
4757+
match common conventions, we still use underscores ("snake case") to delimit
4758+
its words, not "camel case". For instance, <code>Ai_triplets</code> would
4759+
be the code spelling of the phrase “Aᵢ triplets”.
47574760
</p>
47584761
<p class="exception drake">
47594762
Note that the Drake multibody tree and related types have their own naming

0 commit comments

Comments
 (0)