Adopt Google Style Guide for C++ in order to improve consistency in coding style #2483
Replies: 5 comments 5 replies
-
First of all - it will be a huge and boring change. And usually there always be a more important things to do. I believe there is an unofficial not published style Does anyone else see that there is a problem with fragmented and non-transparent code style requirements and there is a lack of information how to join the project and fit to all the requirements? |
Beta Was this translation helpful? Give feedback.
-
I am all for having a style guide, it should be documented and enforceable using a tool, since we dont want to waste developer and reviewer's time in pointing out trivial issues which are best left to an automated tool. |
Beta Was this translation helpful? Give feedback.
-
I agree with all of you guys, but the first thing I would like to do is decide how important this topic is to us (coding style). just to prioritize things in my working queue. I would say this is something of urgency_normal . If asked what is more important, I would answer that it is the quality of the code itself (for example, getting rid of implicit dependencies in new code), the quality of testing (meaning testing carried out by developers) and the completeness of information that developers provide in PRs and in tickets. Let's keep in mind that any documentation tends to become outdated. Almost no one wants to maintain it; the rare ones who want to do that can simply forget. The ultimate approach sound like "the documentation is the code itself". For ex if we have style guide and a tool that can enforce it, then the documentation not really required.
Good comments can be an invaluable source of information even when these become outdated. Interestingly, such information is often unsuitable for inclusion into documentation. We shouldn't underestimate this. The MIOpen developer's community should pay attention to keep github pages clear, complete, and consistent. |
Beta Was this translation helpful? Give feedback.
-
The initial discussion started here #2471 (comment) |
Beta Was this translation helpful? Give feedback.
-
Having a coding style is good, and having a documented coding style is even better. This is all in theory, but the reality is that we have several utilities that can help us, but they cannot do it without the correct configuration, and unfortunately, they cannot do everything. We need to find the intersection point between the desired coding style, the capabilities of the available utilities and the huge code base that we have. I suggest doing the following:
To achieve this I suggest:
|
Beta Was this translation helpful? Give feedback.
-
As the title says Google Style Guide for C++ is fairly detailed down to how to name methods and class members. I personally don't agree with everything it has to offer but I'm hoping that we can all agree to use it so that we don't need to have any code style discussions.
Another goal is to improve the quality of the code (in addition to style) in terms of abstraction, robustness and performance (The style guide has a small number of recommendations on that front).
We can also make agreed upon deviations from the style guide when necessary as long as we document it here or some other document.
@junliume @JehandadKhan @CAHEK7 @DrizztDoUrden @averinevg @atamazov @cderb @iq136boy @bghimireamd : please share your opinion. CC: https://github.com/orgs/ROCmSoftwarePlatform/teams/miopen-devs
Beta Was this translation helpful? Give feedback.
All reactions