Naming convention for params of ctors and setters

前端 未结 12 1879
轻奢々
轻奢々 2021-01-05 00:42

For those of you who name you member variables with no special notation like m_foo or foo_, how do you name parameters to your ctors and setters?

12条回答
  •  执念已碎
    2021-01-05 01:26

    I used to follow the Microsoft convention of prefixing member variables with m_, like m_foo. At my current company the convention is a trailing underscore for member variables: foo_.

    Generally, if you are working by yourself, then use whatever convention you like. If you are working in a team, use whatever the team agrees upon. Overall consistency in a code base is what is important, not the particular convention.

提交回复
热议问题