Skip to content

coding standards: use brackets for all multiline code sections #11

@wStockhausen

Description

@wStockhausen

While it's syntactically correct to do something like:
for (i=1;i<3;i++)
if (j>5){
...more statements
}
it is very to navigate through code with such statements because it can be difficult to find the end of "for" loop.
Using brackets:
for (i=1;i<3;i++){
if (j>5){
...more statements
}
} // i
allows most editors to find the matching bracket when one is selected, thus making it much easier to navigate to the end of the code block. Adding a comment as to which code block is terminated also helps (i.e., the "// i"). Unfortunately, the TPL code is rife with instances of the former. It would be nice if these could be revised as suggested as we have the opportunity (I'm not suggesting a comprehensive code rewrite).

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