We recently had need of a round robin functionality and since there is no round robin class built into .NET I needed to build my own class. It is a fairly simple algorithm, each call returns the next item in the sequence. When the end of the sequence is reached go back to the beginning […]
Tag Archives: C# 6
Overusing the Null-Conditional Operator
The null-conditional operator is the ?. between object and field/property/method. It simply says that if the thing on the left hand side is null then the thing on the right hand side is not evaluated. It is a shorthand, so: if (a != null) { a.DoSomething(); } becomes a?.DoSomething(); And that’s great. It makes life […]