Nightm@re
Dec 3rd, 2003, 02:51 AM
I just started programming in C# about three days ago. I'm still fairly confused on when I should be using structs vs. classes.
Thus far, I know that structs are value types and performance can be increased by utilizing them.
I also know that if I want a parameterless constructor for any reason classes are the only way to go. As well - classes can have destructors while structs can not.
Half the time I just can't decide on whether to use the struct or class keyword. Should I simply use structs if possible? And if so...does this mean many programmers overutilize classes?
Thus far, I know that structs are value types and performance can be increased by utilizing them.
I also know that if I want a parameterless constructor for any reason classes are the only way to go. As well - classes can have destructors while structs can not.
Half the time I just can't decide on whether to use the struct or class keyword. Should I simply use structs if possible? And if so...does this mean many programmers overutilize classes?