C# Pills 15mg's repositories
Getters-and-Setters
A C# Pill that tries to answer the question: Is a property in C# just a collection of two methods?
Lock-vs-Monitor
A C# Pill that tries to peek under the hood of the `lock` instruction. Is the `lock` statement just a syntactic sugar for the usage of `Monitor` class?
Object-Initialization-in-CSharp
A C# Pill that highlights the order in which the fields, properties and constructors, both static and instance, are initialized in C#.
Parallel-Evolution
My target for this pill is to explain the `async-await` construct by presenting a short history of parallel programming.
Virtual-in-Constructor
This pill demonstrates why it is not a good idea to call abstract or virtual methods from the constructor.
Boxing-and-Unboxing
Are the boxing and unboxing processes really as time consuming as it is said?
Disposable-Pattern
The support provided by .NET for reliably release the unmanaged resources, like manually allocated memory.
Inversion-of-Control
Shows how to invert the dependency between two components.
Life-after-await
This is a C# Pill that tries to find out in which context is executed the code written after an awaited asynchronous method..
Life-inside-await
A tentative of reverse engineering the async-await mechanism
Queryable-vs-Enumerable
A C# Pill that highlights that the Linq query applied after a cast to `IEnumerable` is not translated into SQL. Instead, it is run in memory.
Random-Problems
What actually happens when we use a Random instance from multiple threads? Can we do something to make it thread-safe?
Using-vs-Try-Finally
A C# Pill to demonstrate that there is no functional difference between a 'try-finally' block, a 'using' block and a 'using' declaration.
String-Building
What is the performance differences between string concatenation and StringBuilder and string constructor?