What the .... CLS Compliancy ( VB Got it right all the time )

Ok, I am not the most experienced programmer around, But this weekend I started with VS2005. I started with converting my old VB.NET project and converted it to VS2005.

No problem whatsoever. everything seemed fine......

But then I hit the F5 Button to run my project. I was a bit disappointed. I got all kind of CLS compliency errors. I never bothered about CLS compliency but now I have to. So I started reading about it......

Then on this hyperlink Ifound the following text.....

Characters and casing
All CLS-compliant language compilers must follow the rules of Annex 7 of Technical Report 15 of the Unicode Standard 3.0, which governs the set of characters that can start and be included in identifiers. This standard is available at www.unicode.org/unicode/reports/tr15/tr15-18.html.

For two identifiers to be considered distinct, they must differ by more than just their case.

 

Does this mean that VB got it right all the time ?. In VB it was impossible to have two variables that would differ only in ther casing.

Published 06-08-2005 10:16 AM by Patrick Wellink
Filed under:

Comments

# re: What the .... CLS Compliancy ( VB Got it right all the time )

Wednesday, June 08, 2005 1:04 PM by Patrick Wellink
Dear Patrick,

The link you refer to talks about Cross-Language Interoperability. This means that if you build CLS complient, you need to make a difference between identifiers by more than just casing.
So, in C#, you can use 'int Number' and 'int numBer' and that would be 2 different identifiers.
But to be Cross-Language Interoperable you can't use that because a VB.NET user of your component can't see the difference (because VB.NET doesn't use casesensitivity).
So, the article om MSDN is correct.

However, I'm not sure why you should get this error in a VB.NET conversion, because you didn't / couldn't use 'int Number' and 'int numBer' in VB.NET 2003...

# re: What the .... CLS Compliancy ( VB Got it right all the time )

Wednesday, June 08, 2005 2:16 PM by Patrick Wellink
Well Ernst....

The casing has nothing to do with VB but with the specifications. ( as depicted in the URL above)

I just said that in VB it was always like that.... So I don't have to rewrite my programs to be cls compliant.

My guess is a lot of C# programmers have to.......

No the problem I got was ....

Public Class HieperDePiep

Class Name ''Hieperdepiep' is not CLS compliant


# re: What the .... CLS Compliancy ( VB Got it right all the time )

Wednesday, June 08, 2005 2:17 PM by Patrick Wellink
I mean depicted in this url....

www.unicode.org/unicode/reports/tr15/tr15-18.html

# re: What the .... CLS Compliancy ( VB Got it right all the time )

Wednesday, June 08, 2005 10:25 PM by Patrick Wellink
Ofcourse VB is right! ;)

I mean, for scope indication I prefer prefixes over casing any day. The prefixes can give you extra possibilities doing a find.

# re: What the .... CLS Compliancy ( VB Got it right all the time )

Wednesday, June 08, 2005 10:37 PM by Patrick Wellink
HERO !

# re: What the .... CLS Compliancy ( VB Got it right all the time )

Thursday, June 09, 2005 8:20 AM by Patrick Wellink
[comment]
Ofcourse VB is right! ;)
[/comment]

Luckely our "little" project will be 100% pure C#, mate! ;)

# re: What the .... CLS Compliancy ( VB Got it right all the time )

Thursday, June 09, 2005 9:31 PM by Patrick Wellink
The last two or three weeks, I started programming in VB.NET to build multi-threaded embedded applications. Today I had to switch back to C# for half an hour for some maintenance. What struck me was that one gets accustomed very easily to on-the-fly re-compiling during editing in VS2003. Hence, I expected the error indicators (i.e., the wiggly lines). I actually cursed the C# compiler for telling me *after* the compile that I failed to add the semi colons.

# re: What the .... CLS Compliancy ( VB Got it right all the time )

Friday, June 10, 2005 8:24 AM by Patrick Wellink
ROLAND YOU ARE MY HERO....

That's exactly the reason why I didn't switch to c#

And as an added bonus you get FREE CLS compliency with VB.Net....

At least for identifiers that is.......

# re: What the .... CLS Compliancy ( VB Got it right all the time )

Sunday, June 19, 2005 11:27 PM by Patrick Wellink
You may also be interested in my comments here:
http://www.danielmoth.com/Blog/2005/05/clscompliant-now-works.html