Does the ?? operator in C# use shortcircuiting when evaluating?
var result = myObject ?? ExpressionWithSideEffects();
When myObject is non-null, the result of ExpressionWithSideEffects() is not used, but will ExpressionWithSideEffects() be skipped completely?
Yes it does. As ever, the C# language specification is the definitive source1.
From the C# 3 spec, section 7.12 (v3 rather than 4, as the v4 spec goes into dynamic details which aren’t really relevant here):
The second, third and fourth bullets are the relevant ones.
1 There’s a philosophical discussion to be had about whether the compiler you happen to be using is the actual source of truth… is the truth about a language what it’s meant to do or what it currently does?