Pro EP 51: Null Coalescing Assignment Operator

Muhammad Waseem
Become .NET Pro !
Aug 17, 2023

Are you using NULL Coalescing Assignment Operator (??=) for simple if-else?

It assigns the value of its right-hand operand to its left-hand operand only if the left-hand operand is null.

Although it gives less code it is confusing.

To learn more about C# and .NET check the list of resources here

Whenever you’re ready, there are 3 ways I can help you

  1. Subscribe to my Weekly .NET Newsletter of C#/.NET with 6800+ Software Engineers.
  2. Promote yourself to 6800+ subscribers by sponsoring my newsletter (Reach me at mwaseemzakir@gmail.com)
  3. Download my eBook at Gum Road which contains 30+ .NET Tips (With 2500+ Downloads)

--

--