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

Add brief style guidelines. #5

Open
wants to merge 1 commit into
base: composer-dev
Choose a base branch
from
Open

Conversation

pelesh
Copy link
Collaborator

@pelesh pelesh commented Apr 9, 2024

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 to composer-dev branch.

@pelesh pelesh added the documentation Improvements or additions to documentation label Apr 9, 2024
@pelesh pelesh requested a review from reid-g April 9, 2024 18:42
@pelesh pelesh self-assigned this Apr 9, 2024
@pelesh pelesh changed the base branch from composer-dev to develop April 9, 2024 21:12
@pelesh pelesh changed the base branch from develop to composer-dev April 9, 2024 21:12
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 `<<`.
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Collaborator

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

@pelesh pelesh changed the base branch from composer-dev to develop May 3, 2024 18:19
@pelesh pelesh changed the base branch from develop to composer-dev May 3, 2024 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants