Skip to content

Commit d1064a6

Browse files
committed
Comment on the function parameter naming.
1 parent f5c838c commit d1064a6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

03-Style.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,13 @@ Name private data with a `m_` prefix to distinguish it from public data. `m_` st
2727

2828
## Distinguish Function Parameters
2929

30+
The most important thing is consistency within your codebase, this is one possibility to help with consistency.
31+
3032
Name function parameters with an `t_` prefix. `t_` can be thought of as "the", but the meaning is arbitrary. The point is to distinguish function parameters from other variables in scope while giving us a consistent naming strategy.
3133

3234
By using `t_` for parameters and `m_` for module data, we can have consistency with both public members of structs and private members of classes.
3335

34-
Any prefix or postfix can be chosen for your organization. This is just one example. This suggestion is controversial, for a discussion about it see issue [#11](https://github.com/lefticus/cppbestpractices/issues/11).
36+
Any prefix or postfix can be chosen for your organization. This is just one example. *This suggestion is controversial, for a discussion about it see issue [#11](https://github.com/lefticus/cppbestpractices/issues/11).*
3537

3638
```cpp
3739
struct Size

0 commit comments

Comments
 (0)