Can someone explain why this method uses generics
graphics.GraphicsDevice.DrawUserPrimitives<VertexPositionColor>(PrimitiveType.TriangleList, 12, nonIndexedCube);
I am a VB.NET business programmer and I am familiar with generics, but pretty much only use the generic collections. This seems silly to me. With generic collections, I define a collection to be of a certain type, and then where I use it, it is typed, keeping me from doing something stupid and saving me some extra coding. Since the 'definition', <VertexPositionColor>, is right next to the usage, actually in the same method call, I don't see that being the case. What does this give me or is it a performance thing

DrawUserPrimitives
ChrisErven
vgvKarthik
It protect you a little bit from doing silly things because there is a where constraint that limited you to value types (VB: Of T As ValueType). If you would use a reference type there very strange things would happen.
The second part is a performance optimization. The under laying Direct3D need to know the size of one vertex. If you don’t use generics here this size need to be calculated every time you call the function. With the generic it is calculated only once during the JIT compilation.
Handra
Generics are very cool, but hopefully they provide non-generic draw methods as well (I know, the devs hate to add more overloads to their clean and simple api, but they are needed.)
Not all .Net languages will support generics, and the non-generic methods are alot more flexible. You're final version of XNA should be language agnostic.