Skip to content
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

Open
ax3l opened this issue Feb 16, 2018 · 7 comments
Open

CamelCaseIsOutdated #31

ax3l opened this issue Feb 16, 2018 · 7 comments

Comments

@ax3l
Copy link
Member

ax3l commented Feb 16, 2018

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 ;-)

@ax3l ax3l changed the title CamelCaseIsOutdated Function Names: CamelCaseIsOutdated Feb 19, 2018
@ax3l ax3l changed the title Function Names: CamelCaseIsOutdated CamelCaseIsOutdated Feb 19, 2018
@j-stephan
Copy link
Collaborator

Ping! Let us get rid of CamelCase!

@bernhardmgruber
Copy link
Collaborator

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:
https://clang.llvm.org/extra/clang-tidy/checks/readability-identifier-naming.html

@psychocoderHPC
Copy link
Member

Ping! Let us get rid of CamelCase!

I am old, I love camelCase names^^

@j-stephan
Copy link
Collaborator

j-stephan commented May 14, 2020

How old are you? snake_case was already used by Kernighan & Ritchie in "The C Programming Language". ;-)

@j-stephan
Copy link
Collaborator

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

@ax3l
Copy link
Member Author

ax3l commented May 23, 2020

@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.

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

Sounds great :)

@j-stephan
Copy link
Collaborator

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...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants