With .NET 2.0 and VS2005, I half expected CLSCompliant to be turned on by default; however, it wasn't and I kind of understood the decision (it was still kind of early in the product cycle, a lot of developers didn't understand the implications, etc). But now that .NET 3.0, .NET 3.5, and VS2008 have been released, I fully expected CLSCompliant to be on by default - and it's not.
Can anyone at Microsoft explain why that's the case and how that decision was made, or even if it was discussed? I'm a firm believer that all .NET code should default to be CLSCompliant and only in exception cases should it be turned off. With CLSCompliant off by default, there are numerous warnings the compiler doesn't show in the build output that developers should know about. And it's been my experience that with it off by default, most developers don't take a second to turn it on. Heck, I'm willing to bet that most developers assume they *are* writing CLSCompliant .NET code when in fact they aren't. Of course, that also assumes that most .NET developers know what CLSCompliant is and how to turn it on or off, and I'm not sure that's the case.
For me, writing CLSCompliant .NET code is key to having a solid design in place, especially with regards to API design and all public-facing classes and members, so for it to be off by default is an oversight.
If anyone at Microsoft can shed light on this, I'd love to hear it. Seriously.
Print | posted on Wednesday, December 19, 2007 2:15 AM