Session

C# Error Handling Made Functional

You know that lovely feeling when you've written a clever, concise bit of code, and it works perfectly? The one that gets crushed when you realise it's time to add in all of the error checking, input validation, and various other bits of protective code you have to write.

You can't even just return data to the user, you need to think about metadata objects, exceptions - handled and unhandled. All this stuff muddies up what would otherwise be perfectly readable, elegant code.

With Functional Programming, you don't have to compromise. You really can have it all! Robust error handling, which provides the user with all of the information they need, but without line upon line of tedious, ugly protective code - which makes the intention of what you're writing hard to see.

In this talk, I'm going to show how you can take a few relatively simply ideas from the world of Functional Programmoing, which can be implemented in just a few lines of code - and in return save yourselves thousands of lines you don't need to write any more to achieve the same thing.

And never, ever have to see another unhandled exception so long as you live!

Simon Painter

Senior Developer at Health Partners | Microsoft MVP | O'Reilly Author

Telford, United Kingdom

Actions

Please note that Sessionize is not responsible for the accuracy or validity of the data provided by speakers. If you suspect this profile to be fake or spam, please let us know.

Jump to top