Hacker News new | ask | show | jobs
by IshKebab 30 days ago
Very many people have learnt that exceptions are bad and should be avoided, because they are bad and should be avoided. Some of those people work at Google.
1 comments

Author here. Especially in Python, I think exceptions are not evil in any way but when it comes to typing they are a pain. Once gave a somewhat provocative talk about this that exceptions are gotos in a way :-) https://florianwilhelm.info/2025/04/evolution_of_goto/
I wouldn't go as far as evil but they are bad for code quality because they obscure the behaviour of functions. You never know what exceptions can be thrown. Can a function even fail? Impossible to tell. (Don't say "documentation" lol)

The standard answer is checked exceptions, which I'm on the fence about, but they don't seem to be very popular in any case. Python doesn't have them. C++ removed support for them which shows you how unpopular they were. Java has them and IIRC they were kind of ok to use in Android. Kotlin doesn't have them though so I guess the Java people didn't really like them either.