Hello!
When declaring variables without immediately assigning a value, the CLR
(please correct here) assigns a default value according to the (reference)
type of the variable (e.g. string = null, int = 0 etc.).
I always assign default values to my variables, but am unsure whether this
degrades the performance of the instantiation of my classes.
Are the following two classes as fast to instantiate?
public abstract class CmsObjectNode : CmsObject, IXml
{
private Guid cmsObjectID = Guid.Empty;
private string cmsName = null;
...
}
public abstract class CmsObjectNode : CmsObject, IXml
{
private Guid cmsObjectID;
private string cmsName;
...
}
I would assume so, as the variables - after class instantion - yield the
immediate assigned value.
Thanks in advance.
--
venlig hilsen / with regards
anders borum
--