|
|
|
|
|
by spacechild1
235 days ago
|
|
> Exceptions should be reserved for developer errors like edge cases that haven’t been considered or invalid bounds which mistakenly went unchecked. Isn't this what assertions are for? How would a user even know what exceptions they are supposed to catch? IMO exceptions are for errors that the caller can handle in a meaningful way. Random programmer errors are not that. In practice, exceptions are not very different from Result types, they are just a different style of programming. For example, C++ got std::expected because many people either can't or don't want to use exceptions; the use case, however, is pretty much the same. |
|