Hacker News new | ask | show | jobs
by weberc2 2765 days ago
And yet no one is deterred from proper error handling in Go. On the other hand, I see people fail to properly handle errors all the time in our Python/JS shop.

EDIT: This isn't some language partisanship; it's my observations from years of experience with the aforementioned languages (I work in a Python/JS shop). I'm guessing there are no formal data about this, so I'd be curious to hear other anecdotes whether they agree or conflict with mine.

1 comments

Yeah, I'm not sure why you're being downvoted. We also use Python at work and reviewing code is an absolute nightmare because you end up needing to dive deep into each function call to see if there are any exceptions being ignored. We're trying to enforce adding all possible exceptions in the docstrings but it's difficult because third party libraries (and even the standard library!) sometimes don't document them. Typically we have a catch-all Exception in our main loop and recover from there in case there's something we missed in dev and staging. I'd much prefer being able to know which functions have the ability to fail and why.