1/6

The line is not "panics are bad". It is a question about whose mistake the condition represents.

A condition is something the outside world is allowed to do: malformed input, a missing file, a timeout, a closed connection. It is not a bug. It gets a Result.

A bug is a violated invariant your own code was supposed to maintain: an index the function itself computed being out of range, a state machine reaching an unreachable arm. Continuing past it means computing on data you have already proved wrong. It gets a panic!.