| [ directory ] |
|
3.2 The J# languageAnnounced only late in 2001, J# is the official successor of Visual J++. Like J++, J# follows Java's syntax and rules. But unlike Java, applications written using J# can run only on the CLR, and not on a JVM. A J# compiler does not compile .java source files to .class byte codes. Being a true blue .NET language as well, J# is like C# in many ways:
Visual J#.NET includes Jbimp.exe. Jbimp is a tool which can convert prewritten Java .class byte codes into IL assemblies directly. If you have a Javabean in the form of a .class file which you wish to convert into C# codes, you can do either of the following:
One huge caveat ?the use of Jbimp is limited to only JDK 1.1.4 (or earlier) Java byte codes, such as those created using J++'s jvc.exe tool. For J++ developers, there is a migration path for porting a J++ program into J#. Most J++ applications can be ported over quite easily. J# supports legacy J++ features such as J/Direct, Java COM integration, delegates, conditional compilation, and some of the J++ @ directives. [5]
J# has a big limitation ?it supports only Java 1.1.4 API classes. This means that if you have a Java source that uses Swing (or any other post-1.1.4 API class), you cannot simply open that .java file in VS .NET and compile it as a J# source file into IL codes directly. It is for this reason that it is extremely difficult to port pure Java applications which make use of any classes after JDK 1.1.4. [6] For .java files which make use of only 1.1.4 and earlier core Java classes, porting is as simple as opening that file in VS .NET and compiling it as a J# source.
Compared to C#, Java ?and hence J# ?has a poorer language feature set. For example, J# lacks features such as operator overloading and support for C# properties, events, and delegates. Otherwise, both C# and J# can utilize .NET BCL, and you can write programs in either language with the same functionalities provided by the BCL. 3.2.1 Why learn C# instead of J#?If you discount project requirements and specific client instructions, choosing to pick up either C# or J# for developers with a Java foundation is probably a personal choice. If you are a pure (non-J++) Java programmer, I would recommend that you spend a little more time picking up C# instead of J#, even if you have never programmed in C/C++ before. For such cases, I estimate that the learning time needed to pick up C# will be a just little longer than learning J#. Personally, I think the additional language features provided by C# is worth that extra learning time. On the other hand, if you are (or have been) a J++ developer, then the migration path from J++ to J# would be significantly shorter. I would still recommend C# as a more powerful language than J# if you are really serious about .NET. [7]
The advantages of C# over J# are listed below.
The advantages of J# over C# are fewer.
One of the first things a developer starting on .NET has to do is to pick one .NET language from the many available. Assuming no other influencing factors (such as client preference), Figure 3.1 shows my recommended migration path. Figure 3.1. Recommended migration paths to .NET when selecting a language.
|
| [ directory ] |
|