This may be a dumb question, but is there a common practice for initializing collection properties for a user, so they donβt need to create a new specific collection before using it in the class?
Are any of them preferable over others?
Option 1:
public class StringHolderNotInitialized {
Option 2:
public class StringHolderInitializedRightAway {
Option 3:
public class StringHolderLazyInitialized { private IList<string> myStrings = null; public IList<string> MyStrings {
Option 4:
Any other good options for this?
source share