开发者

Why does the standard C++ library use all lower case?

Just curious why the C++ standard 开发者_JAVA技巧library uses all lower case and underscores instead of camelCase or PascalCase naming convention.

Personally, I find the latter much easier to deal with when typing out code, but is there some kind of legitimate reason to use the former?


Main reason : To keep compatibility with the existing code, since they have done it with C also.

Also have a look at these C++ Coding standards, which presents some generic reasoning regarding the importance of convention.


These links discusses about the naming conventions of C/C++ Standard Library.

  • Naming Convention for C API
  • C/C++ Library Naming Convention
  • C Library Naming Convention
  • Why does Java use CamelCase, while C++ doesn't ?


Convention. They've done it that way all along, since the C days and before...and didn't see a good reason to break from that convention (not to mention potentially break compatibility with tons of existing code) just to add caps to a bunch of function names.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜