Level up with the easiest way to measure the performance of your .NET Code. Stop wondering whether your code is slow, start testing to ensure the code you're shipping doesn't have any crippling speed or memory issues. BenchmarkDotNet is the go-to choice for anything performance related in the C#/.NET environment.
There are a lot of ways to return a collection of things. List, IList, IEnumerable, ICollection. Which collection type gives the best performance? Which one should you be using in your code? We benchmark them all to figure out the tidbits of what the costs of each are.
IEnumerable and IQueryable show up everywhere in C#. Looking at the definitions and their usage, in one aspect they're pretty similar, but fundamentally they solve difference problems. Lets take a dive into both of these types and see what use case they're designed for.
What type of for loop is the fastest? The regular for loop, the foreach loop? Using BenchmarkDotNet, we'll answer that question and give you the information you need to know when choosing the best for loop for your situation.
C# is a typed language, and generally requires explicit casting when moving between types. But one language feature, implicit conversion, allows you to implicitly move between types. It's a handy feature that probably shouldn't be overused.
Every C# developer uses the built in types; string, bool or int. But there also exists another set of types, String, Boolean and Int32. What's the difference? Which one should you use? Lets explore how C# namespaces resolve types and examine C#'s alias types.
Sometimes async programming can be confusing. Sometimes programming tutorials can be pretty confusing. Both can be simple when explained through a delicious medium that we all love and enjoy, Pizza! No more confusion, no more synchronous programming.
Entity Framework is a useful and complex library. One aspect I've always been curious about is the AddAsync v. Add method. I finally put the time into researching what the difference is, why you'd use one or the other and some other EF tidbits.
Swagger is an awesome tool for using and testing APIs. Swagger integrates seamlessly with C# and will automatically generate an API interface for your API project. See how easy it is to plug into .NET Core API and start using.
Every programming language is compiled or interpreted to render an output. Learn the basics of how this process works by writing your own interpreter for the brainfuck langauge. A Turing complete language that is only useful for how-to articles like this one.
.NET Core has gone through a lot of transformation. Finally in it's 3.0 release, it finally adds a method that allows you to create an API without any View related code or logic.
The visitor pattern is commonly used with expression trees. It's designed to separate data from algorithm. This separation allows for interesting uses, we'll demonstrate how to print simple mathematical equations in different formats.
Entity Framework takes C# queries and turns them into SQL queries. Expression trees power that mapping and transformation. Expression trees are a nerdy language feature you may not know about, but they power a surprising amount of things in C#.
Async methods are one of the best tools to write performant and scalable web applications. But what is the cost of having async methods that don't actually have any asynchronous functionality? I'm sure you've written one before. Lets take a look at how it degrades the performance of the function.
Pure functions make your life and code better. Every function you write is either Pure or Impure. It's an important distinction that is never really taught in school or at most jobs. Learn about how writing pure functions can make your code easier to test and free from side effects.