Avoid status codes.
type StatusCode = enum Success Error1 ... func f(output: var Type): StatusCode
- Interop with
outputundefined in case of error
- Verbose to use, must first declare mutable variable then call function and check result - mutable variable remains in scope even in "error" branch leading to bugs
Unlike "Error Enums" used with
Result, status codes mix "success" and "error" returns in a single enum, making it hard to detect "successful" completion of a function in a generic way.