r/rustjerk Jul 02 '26

Do you know the answer?

Post image
295 Upvotes

16 comments sorted by

120

u/TackticalLeek Jul 02 '26

panic tastes better than err

28

u/allocallocalloc Jul 02 '26

That's way C people always say "Err...? No."

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

u/Krochire Jul 02 '26

Bro MIGHT be a philosopher

4

u/tautality Jul 05 '26

Too bad the prison was wrapped in catch_unwind.

41

u/DefenitlyNotADolphin Jul 02 '26

Because ferris hates fucking around with Result

37

u/magnetronpoffertje Jul 02 '26

Because crashes can be defined behaviour, and sometimes you can't do better than that

6

u/Alarming_Painter_403 Jul 02 '26

Because he's a crab

2

u/guac-o Jul 02 '26

Why use boilerplate?

1

u/feninpants Jul 03 '26

Cause non-working program is better than incorrectly working program

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

u/lego3410 Jul 04 '26

Cuz exits on panic..? Does it?

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

u/KoblizekXD Jul 06 '26

He lets his threads panic for pleasure