Structs versus classes in .NET

Microsoft's Rico Mariani has two very interesting posts that shed some light on when to prefer structs (value types) and public fields over classes (reference types) and properties. He explains why it is a good thing to break Microsoft's Design Guidelines (partially enforced by FxCop) in certain situations.

If you have some time to spare, go read the first post to ponder on the questions he asks. Then check out the comments made to that post. Finally, read Rico's answers to the questions in the second post.

If you want to cut to the chase, go right to the second post.

Leave a Reply

Your email address will not be published. Required fields are marked *