4 ms·
In practice there is a lot of paths that you don't want to "crash" on, but try the next thing etc.
by the_gipsy 3y ago
In practice there is a lot of paths that you don't want to "crash" on, but try the next thing etc.
- mrkeen 3y agoDon't model those as Exceptions, because they are not exceptional. They are control flow.
- randyrand 3y agoThat idea just leads to confusion, as the line between exceptional or not will always be blurry, and depend on how it is called, the specific input data, your hardware state, etc. you basically end up needing to write your api twice.
- the_gipsy 3y agoYou can't have your pie and eat it too. Some callers will want a Result, some will want to panic. A Result can be panicked on very easily, but handling control flow with exceptions and try/catch has been proven a huge failure.