Design patterns explained with sketches
This article will explain design patterns, which we use on a daily base, with smaller (over)simplified illustrations.
Hey, I'm Steven a .NET Developer in Switzerland. I am a Microsoft MVP. Also, this blog is open source on GitHub.
This article will explain design patterns, which we use on a daily base, with smaller (over)simplified illustrations.
You might have heard that mutable value types are evil. But why is that and why does the .NET framework use them then? Are they really that evil?
Let's have a look at a few examples and have a look what is going on!
Often times your API in your program or library evolves. So you will need a mechanism of telling that a specific API (an interface or just a simple method call) is obsolete and might be not there anymore in the next major version.
Also it can happen that you have a preview version of a API, which might not be rock-stable and the API-surface might change. How do we indicate that to the user?
This edition has the following infographics:
DebuggerDisplayAttribute
ExceptionDispatchInfo
implicit
and explicit
operator.NET knows local functions and lambda expressions. You can almost take them interchangeably, but there are also some differences between them.
This article will show the differences between them.
You might have read, that re-throwing an exception like this: throw exc;
is considered bad practice and you should just do this: throw;
instead.
But why is it like that?
In this article we will have a closer look at LiteDB, a .NET NoSQL Document Store in a single data file. We will discover the advantages of LiteDB and why it is a viable candidate for your next project.
We will also explore what are the differences between a NoSQL and a classical SQL database are and what this has to do with the reminiscent SQL CE or the more modern SQLite database.
In this short blog post I want to show you two silly things so that you can apply right now! Both of them equally silly, but that is not the point (is it ever?).
We will see how to await an integer or TimeSpan
and how to foreach through an integer. All of this thanks to the magic of extensions methods.
This edition has the following infographics:
ConfigureAwait
on IAsyncDisposable
foreach
struct
null
for a Task
C# 11 brings some major improvements for structs. You remember Span<T>
, which you couldn't create?
Now you can. C# 11 allows ref
fields in a struct. Why this is a cool thing and what you can do with it, you will see in a minute.