.NET vs Java

Status
Not open for further replies.

hillbillybob

In Runtime
Messages
341
Other than being from two different companies, what is the difference between Java and .NET

From experience and what I've read, 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 (Windows, via the .NET framework)

They each have their respective technologies that can do their jobs very well. JSP - ASP.NET - JDO/JDBC - ADO.NET, etc.

What are the benefits of each technology, how do they differ, how are they similar, with respect to each other. I know there are open source endeavors such as Mono, but im talking about the purity, Sun's Java Vs. MS .NET.

Discuss Please.
 
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.
 
See, I knew about some of that stuff. ok...so Java is actually interpreted from bytecode in a fashion similar to QBasic? (or VB, I thought VB was interpreted?!?) Which came first, Java or .NET? I always thought of Java as a framework, like .NET is a framework.

I do agree with you on GUI programming being easier in .NET, and the fact that managed environments are so much easier. When you say JIT compilation, do you mean compilation similar to C/C++ - with the ability to run just as fast (as soon as it's compilied)?

Next, I have coded/am coding in both Java, and C#, depending on the sit. Which is more valuable?

For a career, IMO, A good round knowledge fo Java, .NET(VB or C#) and C/C++. What's your opinion
 
Which came first, Java or .NET?
Java. C# came about after Microsoft added proprietary extensions to Java in their J++ product. Sun then threatened legal action. I think I previously posted that information on this forum.

When you say JIT compilation, do you mean compilation similar to C/C++ - with the ability to run just as fast (as soon as it's compilied)?
Well, compilation is just translation of code in some given form to code in a different form. In this case, the JIT compiler is producing x86 instructions on the fly, as necessary. The CLR doesn't execute code as quickly as unmanaged C++ or C code. Microsoft claims that it is possible to get managed .NET code to execute nearly as fast as unmanaged code.

Next, I have coded/am coding in both Java, and C#, depending on the sit. Which is more valuable?
They are both valuable. However, Microsoft is improving C# at a greater rate than Sun is improving Java. Java has its markets just as C# has its markets. If you're programming Windows, use C#. If you're writing code for different operating systems, use Java. I'd also use Java for socket programming rather than C#, but that's really only because I like Java's threading model much better.

I also like Java for embedded systems. I've coded microcontrollers in proprietary languages, assembly, and C, but I wouldn't do it again. The last embedded systems project I worked on made use of a Systronix SaJe microcontroller. The interesting thing about the SaJe is that it uses an Ajile Systems AJ-100 processor, which natively executes java bytecode. This means that the execution speed of the java software for the SaJe is nearly the same (or is the same) as software written in C for a comparable microcontroller. Also, you get all the benefits of using Java rather than C, like managed memory (for most cases), networking, and threads, which are all built into the language. For embedded systems, I am firmly rooted in the Java camp.
 
Nice, a lot of the concepts for OOP, looping, and some of the basics of programming finally became concrete when I was learning Java, Have no idea why, so Java holds a special place in my heart.

A little off topic, but are there any more processors that will execute java natively??? What about .NET????

Second - Hey mods, can we sticky this as a reference?
 
I believe there are other processors that natively execute Java bytecode, but I'm not certain. As for .NET, I am unaware of any processor that natively executes MSIL.
 
Status
Not open for further replies.
Back
Top Bottom