I've seen many ways to deal with date and time. Hiding it behind an interface, a static class with a single property, ambient context, you name it. I never liked any of them. Then the enlightenment came. In one of the projects, I've seen a function u...
How do you start a new project? From my experience, most of the projects begin with a search for a verb. Not any verbs. The important ones! The question arises, how do you spot the important one? That depends on the domain, of course. As an example,...
I was full of doubt about local functions at first. They break some dogmas for me. For example, return from the method isn't the last statement anymore. Then I started to use them. Now I can say that this idea makes code more readable and keep classe...
Working with collections of custom types in xUnit always felt clumsy. To pass such a set of data, you had either create a property or a whole class. No matter which options you choose, it's a lot of boilerplate. What a pleasant surprise was how less ...
Many functional techniques are proving their ground in C# codebases. One of my favorites is the Result type. The most basic form consists of a boolean flag indicating success and an array of errors. But in many cases, tuples are just enough. I fall ...
Recently I've learned that you have no control over tasks after initialization. Awaiting a job is just a way to synchronize and get a response. That naturally brings a question. How to split asynchronous calls into batches? A case from the trenches L...