c# local variable lazy initialization
Posted on 2012-03-28
can someone tell me the pros and cons of lazy initializing local variables? my main concern about using this technique is that there is always the possibility that a variable doesn't get lazy initialized because it's being used in a whole bunch of places. so as opposed to writing lazy initialization code in multiple places possibly, why not just initialize it the moment you declare it.