Question

Are there any non CLS compliant .NET languages in common use these days? It looks like every managed language that ships out of the box with VS2012 supports unsigned integer types, so practically speaking how much trouble is one likely to get into using 'unsigned' in ones public / protected type signatures for stuff going forwards?

It looks like the CLR, CTS and associated tech are largely 'done' at this point so one wonders how much of a deal CLS compliance is for 'modern' .NET code.

Are we jumping through CLS hoops now purely out of momentum?

No correct solution

OTHER TIPS

CLS compliance is a property of code, not of a language. There was an early version of VB.NET where you couldn't write non-compliant code by accident. That didn't last long, it acquired support for unsigned integral types somewhere around 2005.

It is still relevant, you still can write a library that might be used in a language that was ported to .NET and doesn't support unsigned integers or is case-insensitive, etcetera. The approach is simple, you just avoid using non-compliant features in your code and your assembly should work just fine. Which is very easy to do, add this line of code to anywhere:

 [assembly:CLSCompliant(true)]

And the compiler will give you a warning when you broke the rules.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top