Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Just curious why the C++ standard 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?

like image 603
CuriousGeorge Avatar asked Mar 24 '11 03:03

CuriousGeorge


People also ask

Why is C plus plus standard library required?

The C++ Standard Library provides several generic containers, functions to use and manipulate these containers, function objects, generic strings and streams (including interactive and file I/O), support for some language features, and functions for everyday tasks such as finding the square root of a number.

What are the three important parts of C++ Standard Library?

The C++ Standard Library can be categorized into 3 components: containers, iterators, and algorithms.


2 Answers

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 ?
like image 104
Saurabh Gokhale Avatar answered Oct 03 '22 21:10

Saurabh Gokhale


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.

like image 26
cHao Avatar answered Oct 03 '22 20:10

cHao