C.7. Language interoperability issues

Unlike Java's single language platform, C# is just one of the many languages targeted at the .NET platform. There is a possibility that your C# modules will need to interoperate with modules written in other .NET languages. Hence, you should be careful to avoid using keywords in other major .NET languages [5] as identifiers (especially public class members which are visible to other .NET modules).

[5] Since anyone can write a new .NET language and compiler with selected keywords, it is impossible to ensure totally that your identifiers will not clash with any new .NET languages that are yet to be released. It is probably wise to take note of the keywords in VB .NET and J# since these are the other two .NET languages which will be used widely.

Since C# is case sensitive, it is also possible for a class to expose more than one public member of the same name but with different capitalization. [6] The situation may be disastrous if VB .NET codes are trying to access these identically named public members, since VB .NET is not a case sensitive language.

[6] Doing something like this that may lead to confusion is always bad programming practice, regardless of whether your module is to interoperate with other modules or not.

J# keywords are similar to Java keywords.

Table C.4 lists all the VB .NET keywords.

Table C.4. VB .NET keywords
AliasAnsiAsAssembly
AutoByRefByValCase
DefaultDirectCastEachElse
ElseIfEndErrorExplicit
FalseForFriendHandles
InIsLibLoop
MeModuleMustInheritMustOverride
MyBaseMyClassNewNext
NothingnotInheritableNotOverridableOff
OnOptionOptionalOverloads
OverridableOverridesParamArrayPreserve
PrivateProtectedPublicReadOnly
ResumeShadowsSharedStatic
StepThenToTrue
TypeOfUnicodeUntilWhen
WhileWithEventsWriteOnly 

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.217.254.118