I was wondering about the naming conventions in C++, specifically where and what gets capitalized. I guess what I'm asking is (having come from languages like Java and C#) why are things like std::vector and std::string are not capitalized?
As a follow up, if I was typedefing a std::string to be something else (in my case a "world"), should I call it ...
typedef world std::string
or
typedef World std::string
I've looked around at previous posts and style guides (several listed below), but none seemed to address this directly (links below). The Google guide said: "The names of all types — classes, structs, typedefs, and enums — have the same naming convention. Type names should start with a capital letter and have a capital letter for each new word. No underscores." So that makes it seem like it should be the latter -- but this seems odd since the std library doesn't even slightly follow this convention. Is it just one of those things where a bunch of people wrote the std library before styles were standardized and now (for compatibility reason) it is too late to change/update it?
Thanks!
Previous Research:
Aucun commentaire:
Enregistrer un commentaire