2 ms·
Isn't Optional used in a lot of cases where empty means failure?
by shaklee3 6y ago
Isn't Optional used in a lot of cases where empty means failure?
- marcosdumay 6y agoThat's not enough. Hacking failure reporting into an existence API will make your code confusing, and will leave you no way to report multiple types of errors.
- steveklabnik 6y agoIt might be, but that doesn’t make it semantically the correct thing. As always, it depends. But traditionally, most languages that use this strategy have both, and they aren’t interchangeable. I can see this happening more when you only have optional, though.