Tuesday, December 21, 2004

 

Excellent article explaining C# structs

Just came across a great article by Senthil Kumar on structs. Well worth the read for anyone doing C# development. Several things were new to me:
- an instance of a struct can be created without specifying constructor parameters
- structs support interfaces, but not inheritance
- the CLR boxes structs as objects when accessed through an interface, which is a potential performance hit
- foreach and using statements implicitely set variables declared in them to readonly

Comments: Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?