Is naming variables after their type a bad practice?

前端 未结 11 740
孤独总比滥情好
孤独总比滥情好 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:41

    I have the same "problem" on a regular basis. I think it's a problem of abstration: In case of Position I'd suggest to abstract a bit more and introduce a type Point or something like that. Or specify what position is ment:

    position mouse_pointer_pos;
    

提交回复
热议问题