Let's say I have something like this:
public IOrder SomeMethodOnAnOrderClass() { IOrder myOrder = null; if (SomeOtherOrder != null) { myOrder = SomeOtherOrder.MethodThatCreatesACopy(); } return myOrder; }
Why did C # creators require an explicit set from myOrder to null ?
Is there ever a time when you want to leave it unassigned?
Does the null parameter value have a value associated with this? So that you do not want variables that are not assigned to zero to be always assigned? (Even if they are later installed on something else.)
Or do you need to make sure that you "dotted all of your selves and crossed all of your t"?
Or is there another reason?
source share