HackerTrans
TopNewTrendsCommentsPastAskShowJobs

Khao

no profile record

comments

Khao
·hace 11 años·discuss
We don't really do catch-all blocks and our app is monitored on New Relic where we almost always have a 0% error rate (rarely we get <1%, most often related to a new commit that we can fix right away)

The only places where we need good exception handling is when doing I/O (network and filesystem). If you have proper layers to handle those things (with queuing/retrying/logging) you end up with a large codebase with very little places where you have to handle exceptions. Anything that is user-input we use TryParse and we do proper validation on the data before doing anything with it. This method is makes it easier to read because you know what the intent is better than doing parse/catch exception in my opinion.
Khao
·hace 11 años·discuss
The author is painting a pretty bad picure of C# error handling that isn't close to reality.

In reality, you would never call uint.Parse and let the exception bubble up, you'd call uint.TryParse and handle the logic for failure in the method. There is almost always a way to write your code so it doesn't throw exceptions. I'm working on a pretty large C# codebase for a SaaS website and by doing "find in all files" the keyword "catch" I came up with 174 references. For hundreds of thousands of lines of code, we have had to manually catch and handle exceptions only 174 times.
Khao
·hace 11 años·discuss
I doesn't seem available in Canada at all, that looks more like it's the international roaming coverage (from T-Mobile or Sprint)