My thoughts On Exception Handling
This weeks post is a short one due to time constraints. This is going to be a bit of a brain dump on things that are in my head at the moment. I need to put some time into researching standards for exception handling. In C# I have seen many different ways to handle exceptions, some good, some not so good. I have also been introduced to the Erlang philosophy of let it crash. In C# the main areas in which I have seen error handling is either in the UI layer or the data access layer. Since I have dealt with a lot of legacy systems I’ve had to fix a lot of bugs that involve poorly handled errors. On one system, the data access layer actually handled exceptions and returned either null or an empty object which then cascaded up and I always thought why not just handle the exceptions on one layer. This layer could be the exception layer and lie somewhere inbetween the UI and the UI logic. When learning Erlang I realised that my last theory was almost exactly the same as the Erlang theory, have one way to handle errors and try to do it on the highest layer possible. Basically having a standard layer to handle errors would make debugging applications much easier because you could see on the stack where the error occurred. That’s currently it for this post, it’s a bit of a brain dump more than a post. This week I’ve been caught up doing work and doing some DIY so I haven’t had much time. Thanks for reading and please come back next week! It’s going to be a great one.