I have been asked the following question over-and-over: which solution is the faster and better to use in the condition part of the if
keyword, to branch based on a property which might be defined on a nullable reference type:
- to use the null-coalescing operator (??)
- or the equals operator (==)
To give some context let's assume that we branch our code based on a reference type's bool property:
public class SomeClass