Skip to content

Coding style #88

Open
Open

Description

@dreua

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?

Activity

  1. dreua commented on Nov 9, 2022

    @dreua
    MemberAuthor

    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.

  2. cnlohr commented on Nov 9, 2022

    @cnlohr
    Member

    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.

  3. cnlohr commented on Nov 9, 2022

    @cnlohr
    Member

    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.

  4. linked a pull request that will close this issueClang format #98on Jan 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions