-
Notifications
You must be signed in to change notification settings - Fork 14
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
Rename typedefs #17
Rename typedefs #17
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While overall I think this is a good idea to leave _t
to fundamental types, I do worry that many of the new type names can be mistaken for variable names (easy fix and easily spotted, I know).
I think that following https://google.github.io/styleguide/cppguide.html#Type_Names would be better for clarity, where all type names start with a capital letter to differentiate them from potential variable names.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done, Jack! Looks great!
I will leave the final decision up to you, but I would either follow Lee's suggestion and use CamelCase type names or take a page out of the standard library and use a _type
suffix (e.g., see the member types of std::vector
or std::pair
). Just removing the _t
suffix works but may be prone to shadowing.
Jack, should this be changed in the README.md example (and any relevant examples in docs) as well? |
I went with Lee's suggestion in the end, I think it makes sense since Google style is closest to what we've been using thus far. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Nothing to add from my side.
Context:
We have decided to use camel cases for type aliases in accordance with accordance with Google style. We have also decided against the use of
_t
suffixes for aliases of non-fundamental types. The use of_t
suffixes is reserved for aliases of fundamental types (e.gNodeID_t
).Description of the Change:
Changed all type aliases to camel case. Removed
_t
suffix from all aliases of non-fundamental types.Also removed type aliases from test files when they were only used once or twice.
Benefits:
Code quality, consistent style.
Possible Drawbacks:
Related GitHub Issues: