I use to use Structures quite a lot in the VB6 days, and try to avoid them now with .NET. Just wondering if using structures in 2010 instead of a Class is considered nasty?
Thanks for the help.
Choosing a Structure
takes consideration instead of being inherently "nasty". There are reasons why a Structure can be nasty; however there are also reasons a Class
can be nasty in its own way...
Basically when you decide between these two object oriented kinds of containers, you're deciding how memory will be used.
There are different semantics associated with Structure
and Class
in VB.NET and they represent different memory usage patterns.
By creating a Class
you're creating a reference type.
By creating a Structure
you're creating a value type.
Also some good video resources on YouTube if you're an audio learner.
Many articles on the Internet like these MSDN articles to teach the basics and details:
Example
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With