Line length
ID | LAYOUT-5 |
Title | Lines shall be no more than 120 characters long. |
Priority | Recommended |
Severity level | 10 |
Description | Lines shall be no more than 120 characters long, including comments. Use the MATLAB preference for displaying a vertical line at 120 characters. Comments can be automatically wrapped by setting a MATLAB preference. |
Rationale | A line of code should fit on a screen. Long lines of code are difficult to interpret and generally indicate great complexity. |
Avoid:
theText = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut luctus arcu ex, at viverra nibh malesuada ac. Proin vel arcu leo.';
Instead use:
theText = ['Lorem ipsum dolor sit amet, consectetur adipiscing elit. ', ...
'Ut luctus arcu ex, at viverra nibh malesuada ac. Proin vel arcu leo.'];