my gut feeling says I shouldn't do the following. I don't get any warnings about it.
void test(DateTime d)
{
d = d.AddDays(2);
//do some thing with d
}
or is this more proper
void test(DateTime d)
{
DateTime _d = d.AddDays(1);
//do some thing with _d
}
For some reason I have always handled passed parameters like in the second example. But I am not sure if it's really nessesry...maybe it's just unnessary code.
I am not thinking that the calling method would be using the modified value. anyone have any opinions
See Question&Answers more detail:os