My question is more for coding conventions and practice - but are there any impact on memory or performance as well?
I have a method like this which accepts data of SomeType:
public void someMethod(SomeType sm) {
//does something
}
Practice #1:
public void callerMethod() {
SomeType someName = null;
someMethod(someName);
}
Practice #2:
public void callerMethod() {
someMethod(null);
}
Does Practice #1 has any impact on memory reference creation that a programmer should even think of? And is a "preferred practice"?
Should Practice #2 be avoided as "bad practice" because it doesn't give any clue of what data is passed as null? Also it creates problem in case of overloaded methods?