Constructors with single output 
ID | FCNS-3 |
Title | Every constructor shall have exactly one output. |
Priority | Mandatory |
Severity level | 5 |
Description | Every constructor shall have exactly one output: an object of the class. |
Rationale | A second constructor output is unusual, so will be unexpected for readers of the code. |
Avoid:
classdef Computer
methods
function [obj, out2] = Computer(in)
obj.value = in;
out2 = 2 * in;
end
end
end
Instead use:
classdef Computer
methods
function obj = Computer(in)
obj.value = in;
end
end
end