Class names that start with C

前端 未结 12 1925
被撕碎了的回忆
被撕碎了的回忆 2020-12-20 13:44

The MFC has all class names that start with C. For example, CFile and CGdiObject. Has anyone seen it used elsewhere? Is there an official naming convention guide from Mic

12条回答
  •  执念已碎
    2020-12-20 14:10

    Such conventions for variables are useful for languages like Fortran where you don't need to declare the types of your variables before using them. I seem to recall that variables who's names started with "i" or "j" defaulted to integers, and variables who's names started with "r" and other letters defaulted to real (float) values.

    That people use similar for languages where you do need to declare variables - or for class definitions - is probably just a relic of someone misunderstanding the old code conventions from languages like Fortran where it actually mattered.

提交回复
热议问题