G
Guest
I come from a background of Ada and C++ programming, where it was considered
good practice to explicitly initialize every variable.
Now that I'm programming in C# I think that it would be best NOT to
initialize class members, because every type has well defined initialization
anyway.
eg.
class C
{
int i = 0; // redundant
int j; // better?
MyClass m = null; // redundant
MyClass m; // better?
}
What's the best practice?
TIA,
Javaman
good practice to explicitly initialize every variable.
Now that I'm programming in C# I think that it would be best NOT to
initialize class members, because every type has well defined initialization
anyway.
eg.
class C
{
int i = 0; // redundant
int j; // better?
MyClass m = null; // redundant
MyClass m; // better?
}
What's the best practice?
TIA,
Javaman