3 ms·
>The problem is that for the most part needing to check whether an object is null/"valid" should be an exceptional case, not a common one. It's possible to cod
by cube13 14y ago
>The problem is that for the most part needing to check whether an object is null/"valid" should be an exceptional case, not a common one.
It's possible to code around it if you're presenting a packaged executable or product, but if you're creating an API of any sort, or dealing with user input, it should be a standard case.
Blank inputs or null cases should always be checked in that case.
- anonnona 14y agoI don't think you understand. If you don't allow null by default in your type system then you don't have to check for it when you don't need it. Dealing with user input is a separate issue, yes you need to validate it. The problem with every type allowing null is that it infects EVERY object for a situation that isn't always needed or wanted.