Dotnet logo

.NET Tools

Essential productivity kit for .NET and game developers

.NET Tools

.NET Annotated Monthly | November 2022

Did you know? When C# was introduced in 2000, it came with a language construct called “delegate”. It’s kind of a lost art, but it still is a great alternative to interfaces to make code more testable. Whenever a particular delegate is expected, it also accepts a method with the same signature, or a lambda. 

.NET news

Featured content 

We’d like to thank Dennis Doomen for curating this month’s featured content! Dennis is a veteran architect in the .NET space with a special interest in writing clean code, Domain Driven Design, Event Sourcing and everything agile. He is the author of Fluent Assertions, a very popular .NET assertion framework, Liquid Projections, a set of building blocks for building .NET applications based on Event Sourcing and he has been maintaining coding guidelines for C# since 2001. He also keeps a blog on his everlasting quest for better solutions. You can reach Dennis on twitter through @ddoomen.

Event Sourcing, the architecture style that goes hand-in-hand with the Command Query Responsibility Segregation pattern is becoming more mainstream every day. But it doesn’t mean everybody knows what it can do for you and what kind of problems it can help you solve. Check out this recent blog post to learn about 10 scenarios where this architecture style can help you.

Writing code without writing tests is like driving without seatbelts and Rider is an awesome IDE to get the most out of Test Driven Development. But finding the right scope of testing, the so-called “unit” isn’t always easy. I strongly believe that the text-book example of treating every class as the unit is almost always wrong. Check out some heuristics for finding the right scope here or catch me at Update Conference Prague 2022.

And when you’re as heavily invested in automated testing as I am, you must have run into flakiness at some point. This can be caused by relying on static mutable state, using Task.Delay or Thread.Sleep, or when a lot of concurrent (async) paths are executed. The worst part is that they don’t always appear in a consistent way. Being able to use Rider’s Run/Debug Selected Tests Until Failure can be a huge life-saver.

After a decade of Resharper and a couple of years of using Rider, I started to wonder what it would feel like to work with a vanilla Visual Studio and see how far Microsoft came with that. Well, in the summer of 2020 I tried this for a month or two and I can tell you that this wasn’t fun. You can read about my experiences here. This summer, just to be sure, I ran my experiment again (but this time using Visual Studio 2022). I still have to finish a blog post on this, but I’m afraid to report the situation hasn’t improved. 

For a long time I’ve been a fan of naming my automated tests using the convention When_the_delivery_date_is_in_the_past_it_should_throw. However, I recently ran into an article that completely changed my mind about this. I still want functional test names that capture the expected behavior, but now I’m using something like Delivery_dates_in_the_past_are_invalid or Delivery_dates_must_be_in_the_future. In most cases, I don’t need the words should or when anymore.

Programing tutorials and tips 

.NET tutorials and tips

https://twitter.com/TomKerkhove/status/1582988211386580997

Related programming tutorials and tips:

Fun tweets….

Can you explain a loop as well as this kid can?

Interesting and cool stuff

https://twitter.com/rossipedia/status/1580639227313676288?s=20&t=pcg8Ju2cIBt146uRbKoUmQ

And finally, the latest from JetBrains

Here’s a chance to catch up on JetBrains news that you might have missed:

Recordings are available at JetBrains TV (don’t forget to like and subscribe!):

JetBrains .NET Days Online 
JetBrains .NET GameDev Day Online

Check out our .NET Guide! It’s a learning tool with tons of videos, tips, tricks, and info on a variety of .NET related topics.

Blog posts, webinars, etc..:

Don’t miss this fantastic offer! CODE Magazine is offering a free subscription to JetBrains customers. Get your copy today!

Sharing is caring! So share content that you find useful with other readers. Don’t keep it to yourself! Send us an email with your suggestions for publication in future newsletters!

Subscribe to .NET Annotated

image description

Discover more