C# 8 is Introducing Ranges

We have been talking a lot about C# 8 features recently. We have talked about target-typed new expressions, about default interface methods and even about minor features like fixing interpolated verbatim strings. But one feature that we discussed before is the introduction of indexes. That feature will go hand in hand with another feature, the introduction of ranges.
Continue reading C# 8 is Introducing Ranges

Please follow and like us:

C# 7.2 – Let’s talk about readonly structs

With the Roslyn update, this was the first time that C# received minor versions instead of only major ones. Roslyn helped the designers of the language to move in different leaps and provide more stuff in shorter time with minor versions.
In this article we will be discussing about a feature introduced in C# 7.2, the readonly structs

Continue reading C# 7.2 – Let’s talk about readonly structs

Please follow and like us:

C# 8 – Introducing Target-typed new expressions

So far we have talked about how quite a few new features of C# 8. We have talked about how C# 8 fixing interpolated verbatim strings (here), we have talked about the languages new Index Struct and the usage of the Hat operator (here) and we have talked about default interface methods (here). In this article we will talk about another feature that some people might call small and minor, but still very very useful as it can clean up code and remove lots of noise.

Continue reading C# 8 – Introducing Target-typed new expressions

Please follow and like us:

C# 8.x is introducing Records

Quite often in our architectural designs we tend to use DTOs. If you have never heard of a DTO it basically stands for Data Transfer Object. It is meant to describe a class with no bussiness logic whatsoever included in it. Only to hold different types of data and pass it around. In many cases these DTOs only include readonly properties and fields internally. Very often, writing the code for these classes feels like writing a lot of boilerplate code.
Well here is where C# 8.x is coming to simplify the process of creating these classes by introducing Records.
Continue reading C# 8.x is introducing Records

Please follow and like us:

C# 8 – Introducing Index struct and a brand new usage for the hat operator

We have been talking about C# 8 a lot lately. We have talked about how interpolated verbatim strings are being simplified (here), how default interface methods are being introduced (here) and we have many many more features to discuss about as C# 8 is introducing a lot of new and useful stuff.

For today we are going to talk about the Hat Operator. So far the Hat Operator (^) has been used as XOR operator for boolean types and bitwise XOR operator byte/integral types.
In C# 8 it will have a new usage.
Continue reading C# 8 – Introducing Index struct and a brand new usage for the hat operator

Please follow and like us:

C# – Why you should never use the checked keyword – Unless absolutely necessary

So, some of you may not know about this keyword at all, but at one point in your life you may find out and feel that it will be useful to use it when you are doing mathematical operations in your code. Let’s start by discussing what this keyword provides. According to Microsoft documentation, the checked keyword is provided to explicitly enable arithmetic overflow for integer mathematical operations. In the past we have discussed how arithmetic overflows can cause problems and unexpected outcomes from our code. A prime example we mentioned is why Ghandi was a nuclear asshole in Civilization Continue reading C# – Why you should never use the checked keyword – Unless absolutely necessary

Please follow and like us: