Skip to content

Coding Convention #6

Description

@gmgu

We need a coding convention in some parts of our source code.

  • I recommend to avoid prefix or postfix operator inside an array or a function.
    For example, avoid the following command.

    splitCell[numSplitCell++] = c;

    Instead, I recommend to split it into two lines as follows.
    splitCell[numSplitCell] = c;
    ++numSplitCell

  • I recommend to add a single blank line between each logical blocks.
    For example, consider the following code.

    memset(markCell, 0, sizeof(long long)*numNode);

    It can be rewritten like
    memset(markCell, 0, sizeof(long long) * numNode);

  • I recommend to state a command in the next line of its conditional statement (not in the same line).
    For example,

    if (coloring->numCell == numNode) break;

    I think it is better to place break; under the if statement.

I just skimmed the source code, so there can be more issues about the coding convention.
Perhaps we can write a document of the coding convention and update it as we develop this project...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions