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

Format c++ and #51

Open
BGPierce opened this issue Dec 1, 2020 · 2 comments
Open

Format c++ and #51

BGPierce opened this issue Dec 1, 2020 · 2 comments

Comments

@BGPierce
Copy link
Contributor

BGPierce commented Dec 1, 2020

(from the old issues page)
Luis46coco commented on Apr 13, 2017
C ++ writing format and user display formats

I think we should have a common site to share, discuss and reach agreements on internal and external formats, for example

I do not know if it is better (* .bin, * .dll) or with ";" Instead of "," and if you always add a space later or not, or use uppercase or lowercase letters

So far the format seems to be, lowercase and space after ","
I do not know if it's better, ";"

With respect to the c ++ format it seems a little long
command
{
Break;
}

I prefer

Command {
Break;
}

Or for a single instruction inside, use:

Command
Break;

@johng42
Copy link

johng42 commented Mar 8, 2021

AS a counterpoint, I prefer

command
{
Break;
}

since it visually helps me line up opening and closing braces.

No matter the decision, I would suggest a tool like google's cpp linter: https://github.com/google/styleguide/tree/gh-pages/cpplint (which, to my dismay, enforces a line break immediately after an open brace).

@ejaquay
Copy link
Contributor

ejaquay commented Mar 27, 2021

When modifying existing code best to adopt the style that is already there. Unix indent is a good tool for setting style. For new routines I prefer K&R ( indent -kr) or Linux (indent -linux)

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

No branches or pull requests

3 participants