How do you reconcile common C++ naming conventions with those of the libraries

前端 未结 10 2097
执笔经年
执笔经年 2020-12-24 01:14

Most C++ naming conventions dictate the use of camelCaseIdentifiers: names that start with an uppercase letter for classes (Person, Booking

10条回答
  •  南笙
    南笙 (楼主)
    2020-12-24 01:40

    I seem to recall reading a long time ago that they choose to make the standard library different from the recommended coding convention on purpose, to avoid naming collisions. I can't find any reference that mentions that now, however. I remember reading that you shouldn't use leading lowercase letters in type names because they were reserved for the standard libraries. I assume something similar is going on with the use of underscores. I really don't see multiple naming conventions as a problem, since it clearly separates the standard code from code in your project. I always code stuff in my projects using capital camel case for types and lower camel case for methods/members. My current workplace uses capital camel case for methods in addition to types, which irks me greatly. But, they also like Hungarian warts, which even MS has disowned :P

提交回复
热议问题