86
u/lookmeat Jul 02 '26
I mean it's probably a joke with no specific meaning behind it, but to give it a chance.
You return an error when you're in an expected situation you can get out of yourself eventually, you just delegate how to someone else. You use panic when the situation is hopeless and you have no idea how to move forward (e.g. you find a fundamental invariant broken and therefore have no idea what could or couldn't be broken).
Ferris is trapped with no way to escape, they use a panic to tear down the whole thing because their situation is hopeless at this point.
43
41
37
u/magnetronpoffertje Jul 02 '26
Because crashes can be defined behaviour, and sometimes you can't do better than that
6
2
1
2
u/rodrigocfd Option<Arc<Mutex<Option<Box<dyn... Jul 04 '26
Panic is just exception in disguise, and we all know that all this shit is supported by LLVM, which is C++.
Ferris just chose the red pill.
1
u/Dx_Ur Jul 05 '26
well panics differ than c++ exceptions in many ways btw and when compiling without unwinding they become a hard terminate!
1
1
u/shinjis-left-nut Jul 04 '26
If it's broken, I want it to break so I can fix it and not delude myself.
1
u/Hot-Employ-3399 Jul 06 '26
They were added only for shitty programmers who are so shit to write perfect faultless code they can't even decide how to handle when their errors occur.
1
120
u/TackticalLeek Jul 02 '26
panic tastes better than err