In C#, there are many classes that we can use to represent a group of objects that we may manipulate concurrently using multiple threads. One such class is the ConcurrentBag
If we want to optimize our code and improve the performance of our app, there is no one go-to solution. Instead, we analyze our code and try to find where to improve. Understanding Task
C# 11 improves the initialization of objects and struct. Marking one or more properties as mandatory on initialization is now possible and will help you not to forget to initialize your properties correctly. In this post I will show you how it works with the object initializer syntax and the object instantiation with a constructor.
C# 11 brings new syntax for writing plain text. Instead of relying on string interpolation with the character $ and the verbatim with @ character for writting on several lines, C# 11 allows using three double quotes. There is no need to double the quotes in the text to escape a double quote anymore. In this post, I will show you a simple example of it!
In this article, we are going to cover floating-point types in C#. Our focus will be mainly on Double, Float and Decimal data types. We have covered the basic data types extensively, and you can check out this article if you feel the need to brush up on the basics.
Very early in the history of programming, we’ve seen the need to use text on a machine that works with numbers. Over many decades we devised many different ways to construct and analyze text for better understanding by both humans and machines. String interpolation, in the way that C# offers it, is the most elegant and readable way to construct text messages we’ve seen so far.
A SortedSet in C# is a data structure that allows us to store and access elements in sorted order. In this article, we are going to explore how to create and use the SortedSet class in C#. We are also going to look at some of the benefits and drawbacks of using this data structure. Finally, the article concludes with tips on taking advantage of the C# SortedSet in our applications.
I am excited to announce that C# 11 is out! As always, C# opens some entirely new fronts, even while advancing several themes that have been in motion over past releases. There are many features and many details, which are beautifully covered under What’s new in C# 11 on our docs pages. What follows here is an appetizer of some of the highlights – small and big.
Concurrent Collections in C# are a set of collections designed for synchronized multi-thread access. We can find concurrent collections under the System.Collections.Concurrent namespace. Nowadays, where it is getting increasingly important and accessible to work in a multi-threaded environment, concurrent collections are essential. .NET provides a set of concurrent collections. In this article, we will try to understand what concurrent collections are, the collections that have thread-safe variants, and the constraints of concurrent collections.
In this article, we are going to take a look at the HashSet class in C#. We will discuss how to use it and its key features. Also, we are going to see some examples of how to use it in practice. Finally, we’ll compare it to other data structures available in C#.
LINQ is an extremely useful library with many applications. These applications are not all utilized or understood equally. In this article, we are going to take a look at some advanced LINQ capabilities to perform grouping, joining, partitioning, and even converting object types.
In this article, we are going to look at some common C# programming mistakes. We are pretty sure that there are a lot more mistakes that developers make while writing their projects, but here, we will try to summarize the ones we often noticed while working with other developers.