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

Implement a consistent coding convention #83

Closed
jpfoley opened this issue Sep 22, 2012 · 1 comment
Closed

Implement a consistent coding convention #83

jpfoley opened this issue Sep 22, 2012 · 1 comment
Labels

Comments

@jpfoley
Copy link
Member

jpfoley commented Sep 22, 2012

I brought this up in a phone call a few weeks back. The idea is to have a fairly consistent convention for function signatures mainly, in order to make the code a little more readable. I suggested we use Google's convention, where function arguments that change are positioned to the right of input arguments. This is the convention I've used for most (hopefully all) of my code. However, Mike and Ron tell me that they've been using the opposite convention, where arguments that change are placed on the left. I propose we adopt their ordering convention. I will modify the argument-ordering of the functions Guochun and I have written to make them consistent. Aside from that, I generally pass input arguments that are constant by constant reference, while I use pointers for non-constant arguments. This makes it very easy to distinguish between constant and non-constant function arguments at a glance. I'm not sure what people think of this idea, but I find it quite helpful.

@maddyscientist
Copy link
Member

Closing. Essentially enforced by clang-format. See here for more details.

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

No branches or pull requests

2 participants