Hacker News new | ask | show | jobs
by lyorig 31 days ago
Perhaps the author has had their fair share of run-ins with libraries that didn't think their API through like that. But yes, they should.
1 comments

Very many people have been taught that exceptions are bad and should be avoided, because google avoids them.
The adverse knee-jerk hate for exceptions far predates Google also saying they're bad, but certainly that didn't help.
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.
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.