4 ms·
It sounds like badly documented code then. A function, especially if some kind of API boundary, should absolutely state whether it can or can’t return null. Id
by kaba0 3y ago
It sounds like badly documented code then. A function, especially if some kind of API boundary, should absolutely state whether it can or can’t return null.
Ideally everything should be non-nullable, with optionally specified nullability.
- The_Colonel 3y ago> It sounds like badly documented code then. A function, especially if some kind of API boundary, should absolutely state whether it can or can’t return null. Of course, in the type system. Just like we're "documenting" types themselves in the type system and not in JavaDocs.