166
submitted 4 days ago* (last edited 4 days ago) by qaz@lemmy.world to c/programmer_humor@programming.dev

Don't say anyway, say anyhow

you are viewing a single comment's thread
view the rest of the comments
[-] r00ty@kbin.life 1 points 3 days ago

I've seen this in production code before. I might argue if you caught a very specific exception type that didn't matter it might be acceptable. Maybe. But just the overall Exception type... Recipe for disaster.

[-] squaresinger@lemmy.world 1 points 1 day ago* (last edited 1 day ago)

What really sucks, imho, is that lazy programmers won in java's checked exception wars.

With checked exceptions you have to type a little more, but it means that you can be sure you caught every exception type.

By making everything into a runtime exception you never know if you caught all relevant types of exceptions.

Which then again leads to people blanket-catching Exception because that way the app will at least not randomly crash due to a forgotten catch for some obscure exception type.

It's a trash solution for a trash problem caused by lazyness even though there was a real solution available all along.

this post was submitted on 01 Aug 2025
166 points (97.2% liked)

Programmer Humor

25485 readers
1957 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS