Is naming variables after their type a bad practice?

前端 未结 11 720
孤独总比滥情好
孤独总比滥情好 2021-02-02 16:00

I\'m programming C++ using the underscore naming style (as opposed to camel case) which is also used by the STL and boost. However, since both types and variables/functions are

11条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-02 16:34

    This is why I picked up the old MFC practice of prefixing member variables with m_, as in "m_position." A lot of the Java people would do "thePosition" for essentially the same reason, though if you pointed out the similarity at the time they'd turn funny colors and rant at you.

提交回复
热议问题