-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CamelCaseIsOutdated #31
Comments
Ping! Let us get rid of CamelCase! |
I do not think that there is a trend in the modern C++ community to move away from camelCase/PascalCase to snake_case. I like to believe that most communities just stick to what they are used to or what their companies empose on them. So @ax3l I would be interested in the source of your claim ;) Nevertheless, I am fine with most styles, so feel free to pick one. For the transition, clang-tidy seems to be your friend, including automatic fixits: |
I am old, I love camelCase names^^ |
How old are you? snake_case was already used by Kernighan & Ritchie in "The C Programming Language". ;-) |
If we are agreeing on using clang-format: Is there anything that stops us from reformatting to the C++ Core Guidelines? http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines |
@bernhardmgruber My sources are primarily folks tweeting from the ISO C++ committee and our friends from QuantStack (xtensor, et al.). I mean the std libs are snake case (already good enough for me), modern frameworks such as SYCL are snake case, CUDA is old and clutchAllTogetherCase - new CUDA goes straight ISO C++ and consequently snake case, too. We were young and reallyHadToSaveSomeSpace in order to getOurFunctionsInto160CharsWithOurNokias. I believe exactly the same thing™ must have motivated Fortran programmers back in the day ;-) I personally and totally subjectively think there is a trend to snake_case in new C++ libraries without having seen a meta-analysis on it yet. I mean a proper scientific, totally unbiased one. Now that I am getting older, I feel it is more readable and goes coincidentally great with side-by-side comparisons to Python when doing pybind11 bindings for C++ libs.
Sounds great :) |
Since we now have a clang-tidy file which manages the naming style this issue can be closed I think. (Although we still have CamelCase, ugh...) |
It's a hard truth to face, but the modern C++ community is moving away from camelCase, e.g. in member/function names since several years. And let's be honest, abbreviations were never great in it:
doVSWorkaround
,LWFAExample
, ...If we want to maintain our street credibility, we will have to switch to
more_readable_names
as well.Btw, the
STL
always did_
.Hopefully there is a Clang-tool assisting us in the transition ;-)
The text was updated successfully, but these errors were encountered: