Difference between .NET and Java

J

Joe Shreanack

Hello,

I'm kind of new on the programming scene, and I'm curious as to what
platform I should use to write code.
As I understand, .NET takes code written in VB, V C++, C#, etc. and
compiles that code into a bytecode. Then, the bytecode is compiled
native windows code... Right?

It's possible to do this with a Java compiler, right? To compile java
bytecode into native code...

So my question is, what's the advantage to using .NET as opposed to
Java?
 
M

Michael N. Christoff

Joe Shreanack said:
Hello,

I'm kind of new on the programming scene, and I'm curious as to what
platform I should use to write code.
As I understand, .NET takes code written in VB, V C++, C#, etc. and
compiles that code into a bytecode. Then, the bytecode is compiled
native windows code... Right?

It's possible to do this with a Java compiler, right? To compile java
bytecode into native code...

So my question is, what's the advantage to using .NET as opposed to
Java?

Wouldn't this question be better posed in a .NET newsgroup? Or are you
asking what the advantages of Java are over .NET in .NET newsgroups?



l8r, Mike N. Christoff
 
J

Jean Charbonneau

Joe Shreanack said:
Hello,

I'm kind of new on the programming scene, and I'm curious as to what
platform I should use to write code.
As I understand, .NET takes code written in VB, V C++, C#, etc. and
compiles that code into a bytecode. Then, the bytecode is compiled
native windows code... Right?

It's possible to do this with a Java compiler, right? To compile java
bytecode into native code...

So my question is, what's the advantage to using .NET as opposed to
Java?

Java is multi-platform from the start and Microsoft used the idea for their
own product, so I would trust Java more.
Besides I really think Java is the greatest thing ( after women )

Jean
 
P

P.Hill

Joe said:
So my question is, what's the advantage to using .NET as opposed to
Java?

There are no advantages :)

What did you expect? This is a java group afterall.

FYI, there is comp.lang.java.advocacy for discussing why Java or some particular
library/framework etc. is better/worse than something else.

-Paul
 
J

Jim Cochrane

Hello,

I'm kind of new on the programming scene, and I'm curious as to what
platform I should use to write code.
As I understand, .NET takes code written in VB, V C++, C#, etc. and
compiles that code into a bytecode. Then, the bytecode is compiled
native windows code... Right?

It's possible to do this with a Java compiler, right? To compile java
bytecode into native code...

So my question is, what's the advantage to using .NET as opposed to
Java?

I'll assume you meant to ask:

What are the advantages and disadvantages to using .NET as opposed to
Java?

One advantage, as you implied is that you are not stuck with one language -
a multi-language solution is easier to provide than with a java
platform - you have the flexibility, for example, to use .net libraries
that were written in a different language from the one you are using.
From my POV, this is a theoretical advantage. It may also be an actual
advantage, but you'll need someone with extensive experience using .net to
say for sure.

One disadvantage is that MS has implemented .net such that it is not nearly
as portable as java. For example, you can't use MS's .net tools to compile
an executable that will run on Linux or Solaris in addition to Windows, while
you can do this with java. However, the Mono project may eventually solve
the portability problem, if MS lets it get that far.

On the other hand, if the web services protocol lives up to its potential,
the portability problem will be solved - you will be able to write web
applications that are implemented using both .net and j2ee, and other
environments as well.

Other things to look at are how the available toolsets for .net compare to
that of java - how well they support web development, OO programming, etc.
I can't answer that, since I haven't used .net, but perhaps someone else
can.
 
J

Jeremy Deats'

Architecture wise the .NET byte codes gets transformed into a intermediate
language and cached as native code before execution. All most Java2
programming is J2ME specific, but I don't think the Java2 VM Sun provides
for Windows does, one of our Java2 programmers told me that IBM has a
Just-In-Time VM for Win32 that does do this, but it's commerical software
and cost $$$ to license. The result of this is that .NET apps run faster
than Java2 apps on Windows with the default Java2 VM provided by Sun.

Also, Microsoft intermediate language is opened for language developers to
build on (it's actually an Assembly Langauge that you can write in if you'd
like), so C#, VB.NET, COBOL.NET, J#, etc.. all are compiled into MIL
(Microsoft Intermediate Language) if you wanted to create Pearl.NET you
could.

The .NET VM (aka Common Language Runtime) was built primarly with the Win32
API in mind and is closely knit to the Windows platform.

Getting past this the .NET class libraries provide a bit more functionality
than the class libraries provided by Sun (not much, just a bit though). this
is most just utility items (e.g. in .NET if you want to convert from one
data type to another their's a static Convert class that works like a magic
box) there are things missing in .NET though (no Vector, but you can make
one pretty easy)

The primary advantage of .NET (comparing the C# language here to Java2) is
that .NET has Visual Studio.NET (so far I've seen no other IDE that can
match VS.NET, yes I've tried WebSphere, Eclipse, Borland, Sun One, they all
fall short in some areas). The other advantage is ASP.NET which has stolen
the best concepts of JSP, PHP, ColdFusion, and borrowed from classic ASP.
ASP.NET is killer for web apps. (Although the Sun One studio for web
development is good enough that I probably wouldn't switch to .NET just for
ASP.NET at this point)

Java's primary advantage is that you have your choice of third-party tools
(third-party IDE, third-party application server, third-party web server,
etc...) it doesn't bind you to a specific platform and it runs everywhere.

If you're doing Windows development use C# and .NET, if you're app has a
chance to benefit from running on some other platform use J2EE.
 
S

Sudsy

Jeremy said:
Architecture wise the .NET byte codes gets transformed into a intermediate
language and cached as native code before execution. All most Java2
programming is J2ME specific, but I don't think the Java2 VM Sun provides
for Windows does, one of our Java2 programmers told me that IBM has a
Just-In-Time VM for Win32 that does do this, but it's commerical software
and cost $$$ to license. The result of this is that .NET apps run faster
than Java2 apps on Windows with the default Java2 VM provided by Sun.
<snip>

So I guess I'll be the first (but certainly not only) person to
speak to this misconception. JIT has been incorporated into most
JVMs for years. This includes the one from Sun; you don't have to
purchase a commercial product to enjoy this advantage.
I'll leave it to others to expound further...
 
C

Carl Howells

Sudsy said:
So I guess I'll be the first (but certainly not only) person to
speak to this misconception. JIT has been incorporated into most
JVMs for years. This includes the one from Sun; you don't have to
purchase a commercial product to enjoy this advantage.
I'll leave it to others to expound further...

His post was so full of errors about both java and c# that I recommend
that it not be corrected. It should just be ignored entirely.
 
R

Roedy Green

Architecture wise the .NET byte codes gets transformed into a intermediate
language and cached as native code before execution. All most Java2
programming is J2ME specific, but I don't think the Java2 VM Sun provides
for Windows does, one of our Java2 programmers told me that IBM has a
Just-In-Time VM for Win32 that does do this, but it's commerical software
and cost $$$ to license. The result of this is that .NET apps run faster
than Java2 apps on Windows with the default Java2 VM provided by Sun.

You can also statically compile java. See
http://mindprod.com/jgloss/nativecompiler.html
Jet has a free personal version.

http://mindprod.com/jgloss/jet.html
 
T

Tony Morris

His post was so full of errors about both java and c# that I recommend
that it not be corrected. It should just be ignored entirely.

Agreed (s/c#/.NET).
Unless correction is requested.
 
J

Jeremy Deats'

Really? I'd like to know what those errors are? My Java2 knowledge is
limited so I'm not surprised, but what specificly did you find erronious
about my C#/.NET comments?

-Jeremy
 
T

Tony Morris

Really? I'd like to know what those errors are? My Java2 knowledge is
limited so I'm not surprised, but what specificly did you find erronious
about my C#/.NET comments?

"most Java2 programming is J2ME specific"

Blatantly incorrect.

"one of our Java2 programmers told me that IBM has a
Just-In-Time VM for Win32 that does do this, but it's commerical software
and cost $$$ to license."

The IBM VM is provided at no cost.
The IBM VM has "done this" for many years as has the Sun VM.
Don't trust anyone that claims to be a "Java2 programmer" - Java is a tool
for software development, not an industry-preferred focal point of
expertise - this is, of course, a generalisation. At least in my experience,
the ability to develop software and understand the processes and techniques
involved far exceeds the demand to have intimate knowledge of a particular
language.

"The result of this is that .NET apps run faster
than Java2 apps on Windows with the default Java2 VM provided by Sun."

Blatantly incorrect and unsubstantiated.

"Also, Microsoft intermediate language is opened for language developers to
build on (it's actually an Assembly Langauge that you can write in if you'd
like), so C#, VB.NET, COBOL.NET, J#, etc.. all are compiled into MIL
(Microsoft Intermediate Language) if you wanted to create Pearl.NET you
could."

..NET is language independant (provided that language conforms to the Common
Language Runtime). .NET is compiled to MSIL - this is analogous to Java
being compiled to VM bytecode, which is an open specification
(http://java.sun.com/docs/books/vmspec/). One might go on to suggest that
the Java VM is "language independant" in the same way .NET is - the only
difference is that it is not marketed as such i.e. there is no technical
constraint that prevents this from occurring. As I understand it, there are
other languages (not Java) that compile to VM bytecode (Jython for example).

"The .NET VM (aka Common Language Runtime) was built primarly with the Win32
API in mind and is closely knit to the Windows platform."

This is incorrect (but not as blatant as the earlier comments).
The Common Language Runtime was not "built primarily with the Win32 API in
mind." This is evident simply by reading the specification. In fact, many
people that I know agree with my speculation that the CLR was in fact "built
with Java in mind" - that is to say, there are some striking similarities
between Java and the CLR and the fact that some of the "additional features"
provided by C# are not part of the CLR (a trivial example is the CLR
equivalent to Java primitive types and the C# extended types). There are no
similarities between the CLR and the Win32 API. There are a lot of
similarities between the .NET framework and the Win32 API - perhaps you
meant that.

"Getting past this the .NET class libraries provide a bit more functionality
than the class libraries provided by Sun (not much, just a bit though)."

Agreed - but qualification would be nice.

"this is most just utility items (e.g. in .NET if you want to convert from
one
data type to another their's a static Convert class that works like a magic
box)"

But I wouldn't agree that this as an example - shall I qualify my reasoning
(would it benefit anybody?)?

"there are things missing in .NET though (no Vector, but you can make
one pretty easy)"

There are things missing - in fact, there are a lot of collections types
missing from both Java and .NET - Vector is not one that is missing from
..NET - it is (speculatively) intentionally omitted since it is of a flawed
design. The sooner the Java API Specification deprecates it, the better
(personal opinion - not factual). .NET does have the equivalent of the
java.util.List type - but there are some collection types strangely missing
from the .NET framework that appear in the Java API Specification - "Vector"
and list implementations are not one of them.

"The primary advantage of .NET (comparing the C# language here to Java2) is
that .NET has Visual Studio.NET (so far I've seen no other IDE that can
match VS.NET, yes I've tried WebSphere, Eclipse, Borland, Sun One, they all
fall short in some areas). "

This is your personal opinion that I strongly disagree with. Suffice to say
that if I was to elaborate too much, I'd be violating my employment contract
with IBM. I will speculate that anyone who has enough experience with both
..NET and Java will disagree. VS .NET 2005 (currently beta) is only just
introducing the concept of "Code Refactoring" for example. VS .NET falls
short in a LOT of areas.

"The other advantage is ASP.NET which has stolen
the best concepts of JSP, PHP, ColdFusion, and borrowed from classic ASP."

This comment only suggests a lack of understanding of the J2EE architecture
and design intentions - I can't really write a book about why this statement
is completely incorrect - I have pizzas cooking.

"Java's primary advantage is that you have your choice of third-party tools"

Again, blatantly incorrect, but would require a book to explain why (can you
smell something burning?). Anyone who has at least a mild experience with
the Java 2 Programming Language will easily contradict this statement.

"If you're doing Windows development use C# and .NET, if you're app has a
chance to benefit from running on some other platform use J2EE."

Unsubstantiated conclusion since all of your reasoning is incorrect and
misleading.
Good luck gaining the required knowledge and understanding that appears
would be beneficial to you :)

Pizza time.
 
J

Jim Cochrane

...

"The .NET VM (aka Common Language Runtime) was built primarly with the Win32
API in mind and is closely knit to the Windows platform."

This is incorrect (but not as blatant as the earlier comments).
The Common Language Runtime was not "built primarily with the Win32 API in
mind." This is evident simply by reading the specification. In fact, many
people that I know agree with my speculation that the CLR was in fact "built
with Java in mind" - that is to say, there are some striking similarities
between Java and the CLR and the fact that some of the "additional features"
provided by C# are not part of the CLR (a trivial example is the CLR
equivalent to Java primitive types and the C# extended types). There are no
similarities between the CLR and the Win32 API. There are a lot of
similarities between the .NET framework and the Win32 API - perhaps you
meant that.

A practical example demonstrating that the CLR is not closely knit to
Windows is Mono:

http://www.mono-project.com/about/index.html
 
J

Jeremy Deats'

Tony Morris said:
"most Java2 programming is J2ME specific"

Blatantly incorrect.

That was a typo on my part, what I intended to say there was "most of my
Java2 programming is J2ME specific", sorry.
"one of our Java2 programmers told me that IBM has a
Just-In-Time VM for Win32 that does do this, but it's commerical software
and cost $$$ to license."

The IBM VM is provided at no cost.
The IBM VM has "done this" for many years as has the Sun VM.
Don't trust anyone that claims to be a "Java2 programmer" - Java is a tool
for software development, not an industry-preferred focal point of
expertise - this is, of course, a generalisation. At least in my experience,
the ability to develop software and understand the processes and techniques
involved far exceeds the demand to have intimate knowledge of a particular
language.

Where can I download this on IBM's site, it doesn't seem to be available.
"The result of this is that .NET apps run faster
than Java2 apps on Windows with the default Java2 VM provided by Sun."

Blatantly incorrect and unsubstantiated.

"Also, Microsoft intermediate language is opened for language developers to
build on (it's actually an Assembly Langauge that you can write in if you'd
like), so C#, VB.NET, COBOL.NET, J#, etc.. all are compiled into MIL
(Microsoft Intermediate Language) if you wanted to create Pearl.NET you
could."

.NET is language independant (provided that language conforms to the Common
Language Runtime). .NET is compiled to MSIL - this is analogous to Java
being compiled to VM bytecode, which is an open specification
(http://java.sun.com/docs/books/vmspec/). One might go on to suggest that
the Java VM is "language independant" in the same way .NET is - the only
difference is that it is not marketed as such i.e. there is no technical
constraint that prevents this from occurring. As I understand it, there are
other languages (not Java) that compile to VM bytecode (Jython for example).
I've seen diagrams that show .NET being compiled to byte code prior to MSIL,
since I don't have this reference handy I'll just assume it was incorrect,
however my understanding of the JIT process used by .NET is quite a bit
different than the Java2 approach, see:
http://www.gamespp.com/csharp/usingNETJITCompiling.html

The dynamic caching of native code does make for faster execution (at least
according to our benchmarks) which is in part why our shop abandoned J2EE in
favor of C#/.NET I didn't conduct these test, so no I can't unsubstante
this.

Here is one study conducted by a third-party (funded by Microsoft most
likely so taken with a grain of salt):
http://www.gotdotnet.com/team/compare/middleware.aspx

"The .NET VM (aka Common Language Runtime) was built primarly with the Win32
API in mind and is closely knit to the Windows platform."
This is incorrect (but not as blatant as the earlier comments).
The Common Language Runtime was not "built primarily with the Win32 API in
mind." This is evident simply by reading the specification. In fact, many
people that I know agree with my speculation that the CLR was in fact "built
with Java in mind" - that is to say, there are some striking similarities
between Java and the CLR and the fact that some of the "additional features"
provided by C# are not part of the CLR (a trivial example is the CLR
equivalent to Java primitive types and the C# extended types). There are no
similarities between the CLR and the Win32 API. There are a lot of
similarities between the .NET framework and the Win32 API - perhaps you
meant that.

Actually what I ment to say was the .NET has Windows specific functionality
while Java2 (to the best of my knowledge) does not provide any OS specific
classes. Examples of Windows specific functionality in .NET are classes for
working with MSMQ, Windows Registry, Windows Remoting, EnterpriseServices
(for COM+ Interop).Some of this functionality is exposed though the Win32
API so the fact that Microsoft does provide .NET classes around these
Windows specific functions makes it OS specific to me. Microsoft has also
provided a number of optional .NET SDKs that wrap around even more native
APIs (e.g. Managed DirectX)

"Getting past this the .NET class libraries provide a bit more functionality
than the class libraries provided by Sun (not much, just a bit though)."

Agreed - but qualification would be nice.



"this is most just utility items (e.g. in .NET if you want to convert from
one
data type to another their's a static Convert class that works like a magic
box)"

But I wouldn't agree that this as an example - shall I qualify my reasoning
(would it benefit anybody?)?

"there are things missing in .NET though (no Vector, but you can make
one pretty easy)"

There are things missing - in fact, there are a lot of collections types
missing from both Java and .NET - Vector is not one that is missing from
.NET - it is (speculatively) intentionally omitted since it is of a flawed
design. The sooner the Java API Specification deprecates it, the better
(personal opinion - not factual). .NET does have the equivalent of the
java.util.List type - but there are some collection types strangely missing
from the .NET framework that appear in the Java API Specification - "Vector"
and list implementations are not one of them.

"The primary advantage of .NET (comparing the C# language here to Java2) is
that .NET has Visual Studio.NET (so far I've seen no other IDE that can
match VS.NET, yes I've tried WebSphere, Eclipse, Borland, Sun One, they all
fall short in some areas). "

This is your personal opinion that I strongly disagree with. Suffice to say
that if I was to elaborate too much, I'd be violating my employment contract
with IBM. I will speculate that anyone who has enough experience with both
.NET and Java will disagree. VS .NET 2005 (currently beta) is only just
introducing the concept of "Code Refactoring" for example. VS .NET falls
short in a LOT of areas.

I'd argue the usefulness of code refactoring, but that is subjective..
IBM's current IDE product fall a bit short on delivering VS.NET style
"intellisense" functionality and code generation, but the context sensitive
help is another huge beneift that comes to mind. Not to mention the ease of
managing solutions, maybe it's just my lack of experience with other IDEs,
perhaps they should be more intuitive.
 
T

Tony Morris

I'd argue the usefulness of code refactoring, but that is subjective..
IBM's current IDE product fall a bit short on delivering VS.NET style
"intellisense" functionality and code generation, but the context sensitive
help is another huge beneift that comes to mind. Not to mention the ease of
managing solutions, maybe it's just my lack of experience with other IDEs,
perhaps they should be more intuitive.

a) I disagree - which of "IBM's current IDE products" are you referring to?
b) This statement assumes that the "IBM's current IDE" is the most
feature-rich available IDE available. One could easily argue that Intellij
IDEA is in fact far more feature-rich than VS .NET. I'll leave further
comment to other posters - I could never agree that VS .NET is more
feature-rich than today's tools for Java - I don't think anyone reasonably
could.
 
T

Tony Morris

Jeremy Deats' said:
Since you work for IBM doesn't that make you a bit biased?

No.
What makes you think so?
And even then, bias in favour of what? IBM's interests?
Due to the nature of my employment contract, everything I say in this (and
any other public forum) forum is not representative of the views of IBM, but
merely my own personal opinion. But even if it were, I can't see how any of
my comments relate to the interests of IBM.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top