Today I've come across an interesting bit of C# code:
if(!myobject) { /*Do Stuff*/ }
It does seem to behave the same as:
if(myobject == null) { /*Do Stuff*/ }
... but is it really the same thing? I haven't found any documentation about this anywhere yet.
Is there a reason to not use the shorter version or prefer one over the other?
Aucun commentaire:
Enregistrer un commentaire