Thread: .NET vs Java
View Single Post
Old 09-25-2006, 01:43 PM   #2 (permalink)
jaeusm
 
Software Developer

Join Date: Mar 2006

Location: Columbus, OH

Posts: 569

jaeusm is on a distinguished road

Default

Quote:
it seems that Java is one language that can be deployed on many OS via the JVM, while .NET is many languages that can be deployed on one OS
Not quite, but close. Java is a set of technologies, which includes the Java programming language. When speaking of Java in terms of a technology, it is quite similar to .NET. When speaking of Java as a programming language, it is quite similar to C#.

The CLR in .NET is very similar to the JVM in Java. Both of them support multiple languages, but they operate a bit differently. Java source code is compiled to an intermediate language known as Java bytecode. The JVM then interprets the bytecode on the fly. C#, or any other .NET language, is also compiled to an intermediate language known as Microsoft Intermediate Language (MSIL or just IL). The CLR then uses a JIT (just in time) compiler as it is executing the IL to produce native x86 instructions that the CPU will execute.

The main advantage of using Java is that it is platform independent. In my personal opinion, I think Java also has a much better threading model than C#, as well as better performance in mathematical operations.

An advantage of C# is that it is probably the best choice for programming Windows (in .NET, of course). .NET also provides a much better platform for producing GUIs than Java.

The advantage of using .NET or Java over native C++ or C is that they both provide managed code environments. The system will take care of the plumbing or internal maintenance rather than the programmer. Managed code environments also provide increased security.
jaeusm is offline