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

Alias

Ansi

As

Assembly

Auto

ByRef

ByVal

Case

Default

DirectCast

Each

Else

ElseIf

End

Error

Explicit

False

For

Friend

Handles

In

Is

Lib

Loop

Me

Module

MustInherit

MustOverride

MyBase

MyClass

New

Next

Nothing

notInheritable

NotOverridable

Off

On

Option

Optional

Overloads

Overridable

Overrides

ParamArray

Preserve

Private

Protected

Public

ReadOnly

Resume

Shadows

Shared

Static

Step

Then

To

True

TypeOf

Unicode

Until

When

While

WithEvents

WriteOnly

 


From Java to C#. A Developers Guide
From Java to C#: A Developers Guide
ISBN: 0321136225
EAN: 2147483647
Year: 2003
Pages: 221
Authors: Heng Ngee Mok

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net