ComputationalRadiationPhysics / contributing

:books: guidelines and styles to contribute to our projects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CamelCaseIsOutdated

ax3l opened this issue · comments

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

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

Ping! Let us get rid of CamelCase!

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.

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

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