3 ms·
> I can't get it why people would prefer to add "?" to everything instead of just having exceptions which automate that behavior. Good question... Maybe... Be
by ParetoOptimal 4y ago
> I can't get it why people would prefer to add "?" to everything instead of just having exceptions which automate that behavior.
Good question... Maybe...
Because with exceptions it's easy to end up with missing cases or unhelpful catch-all exceptions.
Typically with optional values I find that this is not the case for some reason.
Other interesting links I've yet to consume that may help us get closer to an answer this:
https://news.ycombinator.com/item?id=22225170 https://news.ycombinator.com/item?id=22225170 - "You're better off using exceptions"
https://softwareengineering.stackexchange.com/questions/405038/result-object-vs-throwing-exceptions https://softwareengineering.stackexchange.com/questions/4050...
https://dannyvanheumen.nl/post/why-i-prefer-error-values-over-exceptions/ https://dannyvanheumen.nl/post/why-i-prefer-error-values-ove...