Monday, February 19, 2007

CLS Compliancy

Over time, the number of .Net languages has increased drastically. In addition to the languages provided by Microsoft there is a very large number of new languages being added everyday. Don't believe me, check it out yourself; http://www.dotnetpowered.com/languages.aspx.

Now, each of these languages has its own syntax, and when run on its own will work perfectly well. However, a problem arises when you wish to interoperate between these languages. For example, you might want to write a DLL in Visual Basic .Net (VB) that will be used by some other developer using C#. Sounds simple enough, only its not.

VB is NOT case sensitive (aka case insensitive), therefore, I cannot have two methods that read the same but have different casing; such as SomeMethod and SOMEMETHOD. However, C# is case sensitive and the above example is perfectly OK in C# land. Now, if I were to write a C# class that has these methods, I would NOT be able to use those methods in VB.

Therefore, the need arose for a set of specifications or rules, to govern the way code is written, so that it may be used by all .Net languages; these are called 'Common Language Specifications' or CLS for short. You can all the relevant rules at http://msdn2.microsoft.com/en-us/library/12a7a7h3.aspx.

Code that adheres to these specifications is said to be, CLS Compliant.

Enjoy!!

No comments:

How can you buy Office 365?

Now that we know what Office 365 is , it is important to find out how we can buy the service from Microsoft. While we're at it, we can ...