exercism / cpp

Exercism exercises in C++.
https://exercism.org/tracks/cpp
MIT License
252 stars 205 forks source link

feat: add sublist exercise #768

Closed vaeng closed 6 months ago

vaeng commented 6 months ago

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

vaeng commented 6 months ago

@siebenschlaefer :

PascalCase" and "snake_case".

Isn't that what the core guidelines suggest? I am open to changing it,

siebenschlaefer commented 6 months ago

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.

vaeng commented 6 months ago

I would rather go with consistency. If I get your vote, I will change it to snake case :D

siebenschlaefer commented 6 months ago

I just grep-ed the practice exercises.
The only example solutions with "PascalCase" and "Titlecase" are:

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.