I have a co-worker who's a fan of writing his null checks as follows:
if (!ReferenceEquals(myObject, null))
I, on the other hand, find this syntax cumbersome to read and prefer:
if (myObject != null)
I've found some articles and stack overflow questions discussing the merits of ReferenceEquals with respect to operator overloading, but outside of the operator overloading scenario, is there any benefit to ReferenceEquals vs == ?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…