-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add brief style guidelines. #5
base: composer-dev
Are you sure you want to change the base?
Conversation
Return values of member functions should be of type `int` and used for error handling. Functions return 0 if no error is encounter, return positive value for warnings and recoverable error, and negative value for irrecoverable errors. | ||
|
||
### Output | ||
If an output is needed (for example, a warning needs to be displayed), use `std::cout` and not `printf` as shown below. There should be a space before and after each `<<`. |
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.
Would there be cases where printf
's pretty print would be preferred over std::cout
?
``` | ||
|
||
|
||
### Member variable naming |
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.
Will need to add specification that local variables are snake style.
|
||
```c++ | ||
constexpr double Pi = 3.1415; // No, it should be all caps | ||
constexpr double SQRT_TWO = 1.4142 // No, there is an underscore |
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.
This should be set to valid. So snake-style with all caps. SQRTTWO
is hard to read. This would also standard with C library macros
This should probably be merged to
develop
, but for opportunistic convenience, I suggest we merge it here. Since #1 will likely prompt discussion on new style guidelines, let's direct this PR tocomposer-dev
branch.