|
Chris Maunder wrote:
VB.NET, for example, isn't case sensitive and uses "_" as a special character
True, underscores are used as line continuation characters in VB.NET.
However, variable and function names are allowed to contain underscores too. Example: "m_myMemberVariable", "_anotherVariable".
I'm not sure where this restriction has come from, but I don't think it's from VB. It would be interesting to find out though.
|
|
|
|
|
Note that in C and C++, identifiers starting with _ or __ are reserved. Not that you can't get away with it a good portion of the time, but you really shouldn't try... because someone might come along and add extensions of some sort to their compiler and class lib, and suddenly your code has collisions all over the place...
Medication for us all
You think you know me, well you're wrong
|
|
|
|
|
Gosh.. always thought it's just the __ identifiers, which are reserved..
But in this case I may be wrong.. think some guru's always used _ for private variables.. but I don't know.
All the label says is that this stuff contains chemicals "... known to the State of California to cause cancer in rats and low-income test subjects." Roger Wright http://www.codeproject.com/lounge.asp?select=965687&exp=5&fr=1#xx965687xx
|
|
|
|
|
Gosh.. always thought it's just the __ identifiers, which are reserved..
But in this case I may be wrong.. think some guru always used _ for private variables.. but I don't know.
All the label says is that this stuff contains chemicals "... known to the State of California to cause cancer in rats and low-income test subjects." Roger Wright http://www.codeproject.com/lounge.asp?select=965687&exp=5&fr=1#xx965687xx
|
|
|
|
|
I dont get it. If i write code in C# and then compile it, how is this ever going to impact on VB.Net?
[worldspawn]
|
|
|
|
|
Imagine the small chance that you write some classes that you want other developers to use. These developers find your classes very usefull. Among these developers are some VB.NET programmers. They would not be able to use your class if it's not CLS compliant.
In general, I don't think that one should bother too much about writing CLS compliant code. The most code you write isn't going to be reused anyway. But for the classes that tend to be reusable, the CLS standard should be considered.
I also got the blogging virus..[^]
|
|
|
|
|
OK makes sense. I tried putting [assembly:CLSCompliant(true)] in my code and it told be pretty much everything in my assembly was not compliant. But thats all it told me ("it" being the cs compiler). How are you supposed to know why your code is not CLS Compliant?
[worldspawn]
|
|
|
|
|
|
MadHatter ¢ wrote:
but since internals are often renamed
The internals don't matter here, CLR compliance refers only to what you expose publicly in your assembly.
Regards
Thomas
Disclaimer: Because of heavy processing requirements, we are currently using some of your unused brain capacity for backup processing. Please ignore any hallucinations, voices or unusual dreams you may experience. Please avoid concentration-intensive tasks until further notice. Thank you.
|
|
|
|
|
I've been working on a Trunk Monkey add in to the .NET compilier. it detects crappy naming conventions and the monkey pops out and beats the developer over the head until they promise to not write ugly code...
I can see that becomming a huge *hit* .
/bb|[^b]{2}/
|
|
|
|