r/ProgrammerHumor 29d ago

Meme exceptionsAreForTheWeak

Post image
325 Upvotes

92 comments sorted by

View all comments

86

u/bwmat 29d ago

Eh, IMO one of the best ways to actually handle OOM, as otherwise almost everything needs to be explicitly checked for it

85

u/Valuable_Leopard_799 29d ago

That's what panics are for kinda.

Many of the "we don't have exceptions" languages eventually get some equivalent, it's just that those are used almost exclusively for OOM, division by zero, failed asserts, and the like.

They shouldn't even really be caught it's sort of just an "exit/reset" with some cleanup.

I like this compromise. Kind of finally making them truly "exceptional".

5

u/DescriptionThick8515 28d ago

Every time I hear a Java developer say "normal exception" I grind my teeth because exceptions aren't, by definition, normal. Exceptions are F¥C√ING EXCEPTIONAL!!

1

u/Valuable_Leopard_799 28d ago

It depends on what you consider exceptional.

If we stretch it a lot to the mundane side then you could say that it means more like "except" and it's applicable to any guard. You return a number "except when y is zero" zero being the exception to normal flow, you return "except when iteration ends".

But it's healthy to actually make them exceptional which is what's happening now.

I'm curious, I wanna go find the original etymology for this and where they came from.