-
Notifications
You must be signed in to change notification settings - Fork 811
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
C++ SDK should follow Google Style #713
Comments
/cc @dsazonoff I'm partial to using Google's C++ style guide, but I would be happy if we specified any style guide and stuck with it (using one even if it isn't perfect is better than not using one). And if we want a style guide, picking one that has auto-formatting seems like a big win. |
As per the second point, the C++ SDK docs say:
but I think it would be nice to not leak resources even if we don't provide sophisticated threading support. |
I personally don't have strong opinions here regarding C++, I'm happy to defer to those that do and have actual real experience with C++ (which I definitely do not have!) |
@roberthbailey thanks. I did see the C++ SDK docs. Keeping the implementation simple SGTM. I'm not suggesting anything to the contrary. I suggest fixing the memory leaks, but also there are generally accepted C++ best practices (e.g., http://abseil.io/tips, and the C++ Core Guidelines) that I think the code should adhere to as well. |
Adhering to best practices sgtm. I just want to make sure that we don't force any particular usage pattern upon the client. @dsazonoff is in a different timezone so I think we should give him a chance to chime in before settling anything since he's been working on the C++ SDK. |
SGTM. Following the Google Style guide seems like it might be fairly uncontroversial, so I created #716, which was autogenerated by |
Your PR is OK, I'll add a build step to verify codestyle. The only one difference - we will use C++14 (default in codestyle is C++11).
I'll fix it. So choice is (a) make these changes, and I'll add you to reviewers. |
FYI, it is possible to specify |
Thanks @dsazonoff for that hint. I've just been manually formatting the code as I modify the C++ files since my IDE isn't configured to do it correctly. As per my last comment, I'm going to close this issue. Feel free to reopen if there is any remaining work to be done. |
The C++ SDK should following Google's C++ style guide and generally recommended coding conventions, such as https://abseil.io/tips/
Concrete next steps that I recommend:
Fix all formatting of .cc and .h files with
clang-format -style=Google ...
. Ideally, have a CI build that verifies new PRs are properly formatted.Misc. C++ code cleanups, like more use of
unique_ptr
(I think there are several leaks ofgrpc::ClientContext
currently), remove unnecessary std::string copies, etc.If changes like this sound acceptable to the project owners, I might be able to either (a) make these changes, or (b) review these changes if someone else wants to make them.
The text was updated successfully, but these errors were encountered: