Align struct definition
ID | LAYOUT-18 |
Title | Keep name-value pairs aligned in a struct declaration. |
Priority | Recommended |
Severity level | 9 |
Description | When defining a struct, align the names and values of the struct fields. |
Rationale | This improves readability of the code by making it clearer what fields are defined and by what values. |
Avoid:
s = struct("name", "Albert", "age", 2021 - 1979, "isValid", ismember("Albert", allNames));
Instead use:
s = struct(...
"name", "Albert", ...
"age", 2021 - 1979, ...
"isValid", ismember("Albert", allNames))