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

Coding style #88

Open
dreua opened this issue Sep 14, 2022 · 3 comments · May be fixed by #98
Open

Coding style #88

dreua opened this issue Sep 14, 2022 · 3 comments · May be fixed by #98

Comments

@dreua
Copy link
Member

dreua commented Sep 14, 2022

Reviewing the latest pull request, I noticed (agian) that the code is a bit messy, the placement of braces and parentheses is unusual (at least to my eyes) and inconsistent throughout the project. I'd like to clean that up a bit to ease further development and maintenance.
@cnlohr do you have a preferred coding style for your projects?

A full run of clang-format changes almost every line, I'm not sure that is what we want. I could probably create a .clang-format configuration changing just the stuff that is annoying me the most, would that be a good idea?

@dreua
Copy link
Member Author

dreua commented Nov 9, 2022

Update: I read (in context of Python's "black" formatting) somewhere that it's possible to exclude commits from "git blame" and such, that would be a good idea for any automated formatting. Still not sure we want the full auto-format.

@cnlohr
Copy link
Member

cnlohr commented Nov 9, 2022

I have a personal coding style preference, but I usually try to keep the coding style whatever it was from where it came, or to match the coding style that is within locally. IN GENERAL, my PREFERENCES are:

  • Tabs, not spaces.
  • Spacing is:
if( ( x == y ) )
{
	printf( "hello, world!\n" );
}
  • Hungarian notation fine. But not required.

It's basically the StepMania style, which coincidentally happened to be almost identical to the Valve style. (Except that Valve uses fl for floats and doubles as a prefix).

Do you have recommendations. I'm ok with smaller changes, but I don't like sweeping changes. Specifically because of the git blame issues. If you guys know a way of updating style or have feelings, let me know!

Also, @dreua you should totally bring this up in the Discord.

@cnlohr
Copy link
Member

cnlohr commented Nov 9, 2022

Sam E comments that we have one we have discussed: https://github.com/cnlohr/colorchord/blob/master/.clang-format

Also, I would be willing to do a nuke it and move it if you wanted to.

@dreua dreua linked a pull request Jan 26, 2023 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants