Command Line Parser on .NET5

If you are used to command-line apps, passing arguments to other apps is a very common task. Yes, you can manually parse those values, but once you have multiple parameters it can be a very error-prone code (which is mostly boilerplate anyway). This seems like a problem that someone else might have fixed already, right? So of course we can find a NuGet library that helps us parse these arguments.

TL;DR: https://github.com/commandlineparser/commandline/wiki

Source: Command Line Parser on .NET5 | Windows Dev

C# 9 Deep Dive: Records | Dave Brock

In the previous post of this series, Dave Brock discussed the init-only features of C# 9, which allowed us to make individual properties immutable. That works great on a case-by-case basis, but the real power in leveraging C# immutability is when we can do this for custom types. This is where records shine.

This is the second post in a five-post series on C# 9 features in-depth.

Source: C# 9 Deep Dive: Records | Dave Brock

Asynchronous Programming Models in C#

Pattern Description Based On Notes
Thread based By creating System .Threading .Thread instance Managed Thread Expensive, not recommended
Standard BeginXxx and EndXxx methods By calling BeginXxx method with a user callback; calling EndXxx inside that user callback Thread pool Widely used, standard, recommended, support cancellation and continuation
ThreadPool By calling ThreadPool’s static QueueUserWorkItem method Thread pool Widely used, recommended use as much as possible
Delegate By calling Delegate’s BeginInvoke and EndInvoke instance methods Thread pool Less used
Event based By subscribing to the appropriate event and calling the appropriate method Thread pool Avoid use as much as possible, not recommended
Task based By creating System .Threading .Tasks .Task instance A specified task scheduler Recommended, supports all features of a thread pool pattern, and has many other features
async method and await expression By using async and await keywords Task based pattern The new C# 5.0 asynchronous pattern

Read more in The Asynchronous Programming Models (C# 5.0 Series) at CodeProject