The question I often ask myself is, if you need to call one method on an object, is it best to use a variable? So far I have guessed that the answer is Yes - what are your choices and reasons for this?
With variable:
MyObject mo = new MyObject(); mo.MyMethod(); //mo not used again
Without variable:
new MyObject().MyMethod();
I'm especially interested in .NET, however, if there are any dangerous dots in other languages, I would also rather be warned.
Matth source share