4 ms·
A panic is superior to a segfault, because panics can (and should — if they don’t, then yes, that’s lazy) include a programmer-specified error message. A segfau
by dkersten 6y ago
A panic is superior to a segfault, because panics can (and should — if they don’t, then yes, that’s lazy) include a programmer-specified error message. A segfault just says “oops” (and a hopefully a stack trace in both cases).
I mean, yes, if a program can recover, it should, but in the case of “error and quit”, panic is an improvement over segfault.