I'm having a hard time getting to sleep tonight (probably too much sugar in the strawberry milk) so I thought I would write out what is on my mind.
Classes vs. Structs.
In C# and VB.Net there are both Classes and Structures which can act fairly similarly, but the have differences that make one more appropriate in a situation and the other in another situation. For my little geometry program I have been debating back and forth on which to use for the shapes.
So far I have used Structs as it just seems natural that they should be. The other advantages is the natural garbage collection, and that they are initiated on the stack rather than the heap so they are lighter to fling around.
But there are disadvantages for example not being able to use inherited classes. This is what I'm debating over.
Classes are a little heavier and tend to be initiated on the heap so there is possibility that there could be some lag to their use. But they can Inherit other classes which means that you can create a base class with all of the display stuff packaged up into the class which other classes can inherit and use like it is their own. The other classes could take care of all of the other weird stuff but retain the same basic variables.
On the other hand both classes and structs can use interfaces. Interfaces are similar to inheritable classes except that they only define what a class or struct must contain to be interfaced as it's type. This means you have one interface with a whole bunch of heads defined but nothing else. It also means that in order for a class or struct to be defined as that type it must contain full definitions for those pieces which the interface defines. This can bloat the code a little.
So, Define them like I already have as structs and continue adding the rendering and graphical property code, or redefine as classes and split off the graphical property code to an inheritable class while retaining the rendering code in the interface?
I've only been thinking it through so far, the idea seems plausible classes might offer the advanced flexibility I'm looking for. But I'll have to see if such a hybrid works when I start playing with the code again.

