Closed vaeng closed 6 months ago
@siebenschlaefer :
PascalCase" and "snake_case".
Isn't that what the core guidelines suggest? I am open to changing it,
Interesting, I didn't realize that they used this style in their examples pretty consistently.
I know that the editors of the C++ Core Guidelines reluctantly added some advice after having been asked multiple times.
They recommend "underscore_case" (a.k.a. "snake_case") if there are no other ideas or existing conventions (https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rl-camel).
In my own experience most C++ projects (including this C++ track) either use "PascalCase" or "snake_case" for types, and either "lowerCamelCase" or "snake_case" for variables. I found a lot of names for different styles on the web (e.g. "flatcase", "SCREAMINGCASE", "camel_Snake_Case", "Title_Case", "kebab-case") but nothing for this "Title_snake_case" (my own term).
But the C++ Core Guidelines are an authority, I withdraw my objection.
I would rather go with consistency. If I get your vote, I will change it to snake case :D
I just grep-ed the practice exercises.
The only example solutions with "PascalCase" and "Titlecase" are:
enum DelimiterState
class Bankaccount
class Complex
class HighScores
enum class Bearing
and class Robot
class List
and struct Element
Everywhere else we use "flatcase" or "snake_case" for class
, struct
or enum
.
Choose what you like more, I'm fine with all of them.
Fails to compile under windows. I don't see if
std::each
has any problems on windows system. I might have to change the example.cpp