[OTHER] Inconsistent coding style with .clang-format #163

Closed
opened 2026-01-29 15:06:03 +00:00 by claunia · 10 comments
Owner

Originally created by @yaoyhu on GitHub (Jun 12, 2023).

What would you like to share?

What is the actual coding style for Algorithms/C?

The online documentation suggests that this should be consistent with the CMU Style, which has been followed with CONTRIBUTION GUIDELINES.
However, it appears that the use of parentheses in all code within the repository does not conform to this CMU coding style.

Additional information

I wasted 30 min on this: I thought that there was an issue with my VS Code settings or with Clang-Format, but I later realized that the problem was with the inconsistency between the .clang-format file and the coding standards.

Originally created by @yaoyhu on GitHub (Jun 12, 2023). ### What would you like to share? What is the **actual** coding style for Algorithms/C? The online documentation suggests that this should be consistent with the [CMU Style](https://users.ece.cmu.edu/~eno/coding/CCodingStandard.html), which has been followed with `CONTRIBUTION GUIDELINES`. However, it appears that the use of parentheses in all code within the repository does not conform to this CMU coding style. ### Additional information I wasted 30 min on this: I thought that there was an issue with my VS Code settings or with Clang-Format, but I later realized that the problem was with the inconsistency between the .clang-format file and the coding standards.
claunia added the Stalebug labels 2026-01-29 15:06:04 +00:00
Author
Owner

@Panquesito7 commented on GitHub (Jun 12, 2023):

Those coding guidelines are very old now (5+ years).
We probably should either remove it or update them.

@Panquesito7 commented on GitHub (Jun 12, 2023): Those coding guidelines are very old now (5+ years). We probably should either remove it or update them.
Author
Owner

@yaoyhu commented on GitHub (Jun 12, 2023):

Those coding guidelines are very old now (5+ years).
We probably should either remove it or update them.

I think the coding style of CMU is very good, and LLVM and Google both use this type of formatting for their parentheses. Therefore, I think it's better to reformat the code in the repository.

@yaoyhu commented on GitHub (Jun 12, 2023): > Those coding guidelines are very old now (5+ years). > We probably should either remove it or update them. I think the coding style of CMU is very good, and LLVM and Google both use this type of formatting for their parentheses. Therefore, I think it's better to **reformat** the code in the repository.
Author
Owner

@Panquesito7 commented on GitHub (Jun 12, 2023):

Sounds good to me. 👍
We should wait for the input of other maintainers, though.

@Panquesito7 commented on GitHub (Jun 12, 2023): Sounds good to me. 👍 We should wait for the input of other maintainers, though.
Author
Owner

@github-actions[bot] commented on GitHub (Jul 13, 2023):

This issue has been automatically marked as abandoned because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions[bot] commented on GitHub (Jul 13, 2023): This issue has been automatically marked as abandoned because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Author
Owner

@github-actions[bot] commented on GitHub (Jul 21, 2023):

Please ping one of the maintainers once you add more information and updates here. If this is not the case and you need some help, feel free to ask for help in our Gitter channel or our Discord server. Thank you for your contributions!

@github-actions[bot] commented on GitHub (Jul 21, 2023): Please ping one of the maintainers once you add more information and updates here. If this is not the case and you need some help, feel free to ask for help in our [Gitter](https://gitter.im/TheAlgorithms) channel or our [Discord server](https://the-algorithms.com/discord/). Thank you for your contributions!
Author
Owner

@realstealthninja commented on GitHub (Jul 21, 2023):

Those coding guidelines are very old now (5+ years).
We probably should either remove it or update them.

I think the coding style of CMU is very good, and LLVM and Google both use this type of formatting for their parentheses. Therefore, I think it's better to reformat the code in the repository.

CMU sounds good

@realstealthninja commented on GitHub (Jul 21, 2023): > > Those coding guidelines are very old now (5+ years). > > We probably should either remove it or update them. > > I think the coding style of CMU is very good, and LLVM and Google both use this type of formatting for their parentheses. Therefore, I think it's better to **reformat** the code in the repository. CMU sounds good
Author
Owner

@github-actions[bot] commented on GitHub (Aug 21, 2023):

This issue has been automatically marked as abandoned because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions[bot] commented on GitHub (Aug 21, 2023): This issue has been automatically marked as abandoned because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Author
Owner

@yaoyhu commented on GitHub (Aug 21, 2023):

I've modified the `.clang-format' within my PR #1283, which satisfies the CMU coding standard.

@yaoyhu commented on GitHub (Aug 21, 2023): I've modified the `.clang-format' **within** my PR #1283, which satisfies the CMU coding standard.
Author
Owner

@github-actions[bot] commented on GitHub (Sep 21, 2023):

This issue has been automatically marked as abandoned because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions[bot] commented on GitHub (Sep 21, 2023): This issue has been automatically marked as abandoned because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Author
Owner

@github-actions[bot] commented on GitHub (Sep 28, 2023):

Please ping one of the maintainers once you add more information and updates here. If this is not the case and you need some help, feel free to ask for help in our Gitter channel or our Discord server. Thank you for your contributions!

@github-actions[bot] commented on GitHub (Sep 28, 2023): Please ping one of the maintainers once you add more information and updates here. If this is not the case and you need some help, feel free to ask for help in our [Gitter](https://gitter.im/TheAlgorithms) channel or our [Discord server](https://the-algorithms.com/discord/). Thank you for your contributions!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/C#163