|
|
|
|
|
by maleldil
1100 days ago
|
|
> > Don't panic > Good idea in general, but panicking is a great tool when the program is in a state that was not predicted by the programmer or cannot be recovered from. "In general, avoid panicking" would be better advice. The disclaimer at the top of the item agrees: > The title of this Item would be more accurately described as: prefer returning a Result to using panic! (but don't panic is much catchier). Later on: > If an error situation should only occur because (say) internal data is corrupted, rather than as a result of invalid inputs, then triggering a panic! is legitimate. Most of your criticism boils down to "general idea is fine, but there are important special cases". Which is expected, to be honest. It's difficult to give general guidance that's correct for everyone. |
|