Error handling in .NET Part 2: The Try and the Result patterns

Alternatives to the Exception pattern In my last article, I wrote about the exception pattern. It has great benefits but also great performance implications. Because of these, and following Microsoft recommendations, I’ve also written that we should only use them for exceptional errors. So what do we do when we have to handle an error? Let’s get to it. The “Check and Do” pattern Disclaimer: I’ll include this pattern just for completeness....

February 1, 2024 · 6 min

Error handling in .NET Part 1: The exception pattern

Exception pattern I had some discussions about exceptions at work, especially for performance reasons: We maintain a platform that has both high volumetry and low latency constraints. The document made by one of my teammates (Hi Olivier!👋) included observations that I didn’t know or that I heard about, but never had the opportunity to verify. This made me want to dig a bit deeper and learn more about this topic. This article is the result of my findings....

January 19, 2024 · 9 min

Performance comparaison of string concatenation strategies

Recently, I’ve had a conversation with Davide Bellone, on LinkedIn about the different strategies of string concatenation and their relative performance (You can read its post here). His take was that, even though the built-in class StringBuilder is generally the most performant way to concatenate string, it isn’t always the best choice, especially with fewer items. To prove his point, he showed the benchmark he ran with the associated code :...

January 1, 2024 · 3 min