Comparison of Java and .NET: Difference between revisions

From Citizendium
Jump to navigation Jump to search
imported>Tom Morris
m (corrected and linked Windows Vista)
mNo edit summary
 
(30 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{subpages}}
{{subpages}}
{{TOC|right}}
The striking similarities between the two competing platforms leads many people to attempt a '''comparison of Java and .NET'''.  The [[Java platform]] is older, dating from the mid-1990's.  But in 2000, [[Microsoft]] introduced the [[.NET Framework]], a new platform with a Java-like language ([[C sharp|C#]]) and associated development tools.   
The striking similarities between the two competing platforms leads many people to attempt a '''comparison of Java and .NET'''.  The [[Java platform]] is older, dating from the mid-1990's.  But in 2000, [[Microsoft]] introduced the [[.NET Framework]], a new platform with a Java-like language ([[C sharp|C#]]) and associated development tools.   


Line 6: Line 7:
From a historical viewpoint, the two systems may be seen as having different goals.  A primary goal for Java was to enable a program to run on several different operating systems; this was accomplished by providing implementations of the Java virtual machine for all prevalent [[operating system|operating systems]], including members of the [[Unix]] family, [[Linux]], [[Mac OS X]] and most versions of [[Windows]].
From a historical viewpoint, the two systems may be seen as having different goals.  A primary goal for Java was to enable a program to run on several different operating systems; this was accomplished by providing implementations of the Java virtual machine for all prevalent [[operating system|operating systems]], including members of the [[Unix]] family, [[Linux]], [[Mac OS X]] and most versions of [[Windows]].


Microsoft has been widely criticized for only implementing its .NET runtime "only on Windows." Such criticism does not take into account that Windows is not a single operating system (at least not from the viewpoint of a programmer who must call routines in the operating system).  Even before [[Windows Vista]] appeared in 2007, there were already approximately 35 versions of Windows, all with slightly different application programming interfaces (API's).  The difficulty of developing software for these many different Windows systems had led to a situation called "[[DLL hell]]", where the wrong versions of dynamic link libraries (DLL's) were encountered by programs trying to run.  Creating the .NET framework solved this huge problem for Microsoft by making all versions of Windows alike to programmers.
Microsoft has been widely criticized for only implementing its .NET runtime "only on Windows." Such criticism does not take into account that Windows is not a single operating system (at least not from the viewpoint of a programmer who must call routines in the operating system).  Even before [[Windows Vista]] appeared in 2007, there were already approximately 35 versions of Windows, all with slightly different application programming interfaces (API's).  The difficulty of developing software for these many different Windows systems had led to a situation called "[[DLL hell]]", where the wrong versions of dynamic link libraries (DLL's) were encountered by programs trying to run.  Creating the .NET framework solved this huge problem for Microsoft by making all versions of Windows alike to programmers. From the other side, Java also has been always available under Windows as well, equally isolating the programmer from specifics of the current Windows version and providing its own solution for this important problem.


In fact, some .NET programs can run on non-Windows platforms.  [[Miguel de Icaza]] (co-creator of [[GNOME]]) has created an [[open source]] implementation of the .NET framework for Unix-like operating systems; it runs on [[Mac OS X]], [[Linux]] and [[Sun Microsystems|Sun's]] [[Solaris]]).  Called [[Mono]], this independent implementation of a "common language runtime" is based on .NET's ECMA/ISO standards<ref name="Mono Project Main page">{{cite web| url=http://www.mono-project.com/Main_Page | title="Mono Project Main page" | date=Retrieved 2007-04-25}}</ref> and is not under the jurisdiction or ownership of Microsoft.
In fact, some .NET programs can run on non-Windows platforms.  [[Miguel de Icaza]] (co-creator of [[GNOME]]) has created an [[open source]] implementation of the .NET framework for Unix-like operating systems; it runs on [[Mac OS X]], [[Linux]] and [[Sun Microsystems|Sun's]] [[Solaris]]).  Called [[Mono]], this independent implementation of a "common language runtime" is based on .NET's ECMA/ISO standards<ref name="Mono Project Main page">{{cite web| url=http://www.mono-project.com/Main_Page | title="Mono Project Main page" | date=Retrieved 2007-04-25}}</ref> and is not under the jurisdiction or ownership of Microsoft. From the other side, Java implementations for various operating systems come from the same vendor and are much more comparable with each other both in terms of performance and various subtle behavior inside the libraries. On the contrary, Mono project, while providing .NET under Linux, is a completely different implementation so more issues can be expected when migrating. Java system library is quite large and unified over various platforms when .NET offers much smaller standard library with multiple extensions that may or may not be available under different implementation of .NET.


The .NET framework and the Java platform have diverged in various other ways, including that .NET was designed to allow many different programming languages to use its runtime and libraries (whereas the Java platform was not used for multiple languages until very recently).  There was no theoretical reason for Java being the only language that initially used the Java runtime.  It was only since perhaps 2006, in response to Microsoft's multi-language .NET strategy, that Sun finally began a push to get additional languages  "targeting" the Java runtime.
The .NET framework and the Java platform have diverged in various other ways, including that .NET was designed to allow many different programming languages to use its runtime and libraries (whereas the Java platform was not used for multiple languages until very recently).  There was no theoretical reason for Java being the only language that initially used the Java runtime.  It was only since perhaps 2006, in response to Microsoft's multi-language .NET strategy, that Sun finally began a push to get additional languages  "targeting" the Java runtime.


===Platform comparison===
==Platform comparison==
*Java was the model for Microsoft when it created the [[C sharp|C#]] [[programming language]].
*Java was designed to be cross-platform; .NET was designed to be cross-language:
**Java provides freedom from ''all'' OS differences (with diligence), by making necessary cross-platform compromises. Java also provides cross-''language'' calling via JNI but it is too complex for free and frequent language mixing. JNI is more suitable for accessing OS or hardware features that are only reachable from C.
** .NET makes dozens of versions of Windows alike for programmers; it eliminates the "DLL hell" which formerly occurred when installing Windows applications. However this important-by-itself feature does not create a big difference, as Java under Windows also provides the unified runtime environment.
** .NET libraries can be used by any of the .NET compiled languages (of which there are dozens); libraries can be written in any .NET language. Java's native interface was originally restricted to C and C++.
*the two platforms compete fiercely in the world wide web
**[[Java Server Pages|JSP]]s are usually used with Apache web servers (Linux or Unix); these are [[HTML]] interlaced with code, that when called are compiled to Java Servlets. However the JSP engine can also run on its own on various platforms, including Windows.
*** called "servlets" if all code
**  JSP's can utilize normal java code via a 'include'.
** [[Active Server Pages|ASP]]s require Microsoft's [[Internet Information Server|IIS]]6 web server; these are HTML interlaced with code
*** called "web handlers" if all code
** both Linux and Microsoft web servers use load-balancing across mirrored web farms to scale up
* so-called "dynamic" languages such as [[Ruby (programming language)|Ruby]] are seen by some as the next stage beyond Java and .NET
** Both .NET and Java now run Python and Ruby through Jython, JRuby, IronPython and IronRuby.
* Following [http://www.tiobe.com/content/paperinfo/tpci/index.html Tiobe index], Java currently seems more popular so Java specialists may be easier to find.


<ul>
==Java VM Languages==
<li>Java was the model
Several different languages have been ported to run on top of the JVM, since about 2006, with a wide variety of programming styles<ref>[http://www.is-research.de/info/vmlanguages/ Programming languages for the Java Virtual Machine]</ref>.
for Microsoft when it created the [[C sharp|C#]] [[programming language]]<ul>
 
<li>Java and C# code look very similar; it is fairly easy to switch
* [[Java programming language|Java]]
between the two</li>
* Python, via Jython
</ul>
* Ruby, via JRuby
</li><li>Java is cross-platform; .NET is cross-language:<ul>
* Scala, a high-level language with a highly sophisticated type system
<li>Java provides freedom from <i>all</i> OS differences (with diligence), by making
* Groovy
necessary cross-platform compromises; Java does
* Clojure, a LISP-like language
    <b>not</b> provide cross-<i>language</i> calling</li>
* Rhino, an implementation of JavaScript
<li>.NET makes dozens of versions of Windows alike for programmers; it eliminates the "DLL hell" which formerly
* JavaFX, a new declarative language to define the user interface.
occurred when installing Windows applications</li>
* IDL (works with built-in CORBA engine)
<li>.NET libraries can be used by any of the .NET compiled languages (of
 
which there are dozens); libraries can be written in any .NET language</li>
==.NET Languages==
</ul>
A great number of languages have been ported to run on top of the .NET virtual machine<ref>[http://www.dotnetpowered.com/languages.aspx dotnetpowered Language List]</ref>. Some of the well-known languages include:
</li><li>the two platforms compete fiercely in the world wide web<ul>
* C#
<li>[[Java Server Pages|JSP]]s require Apache web servers (Linux or Unix); these are [[HTML]]
* VB.NET
interlaced with code</li>
* ASP.NET
<li>&nbsp;&nbsp;&nbsp; called "servlets" if all code</li>
* F#
<li>[[Active Server Pages|ASP]]s require
* C++
Microsoft's [[Internet Information Server|IIS]]6 web server; these are HTML interlaced with code</li>
* Python, via IronPython
<li>&nbsp;&nbsp;&nbsp; called "web handlers" if all code</li>
* Ruby, via IronRuby
<li>both Linux and Microsoft web servers use load-balancing across mirrored web
* IronLisp / IronScheme / L# are all LISP/Scheme implementations on the .NET platform
farms to scale up</li>
* JScript.NET implements JavaScript on .NET
<li>so-called "dynamic" languages such as [[Ruby programming language|Ruby]] are seen by
 
some as the next stage beyond Java and .NET</li>
See the [[List of languages using the .NET Framework]] for a more exhaustive list.
</ul></li>
<li>it's an arms race!</li>
</ul>


==References==
==References==
<references />
{{reflist}}[[Category:Suggestion Bot Tag]]
 
[[Category:CZ Live]]
[[Category:Computers Workgroup]]

Latest revision as of 11:00, 31 July 2024

This article is developing and not approved.
Main Article
Discussion
Definition [?]
Related Articles  [?]
Bibliography  [?]
External Links  [?]
Citable Version  [?]
 
This editable Main Article is under development and subject to a disclaimer.

The striking similarities between the two competing platforms leads many people to attempt a comparison of Java and .NET. The Java platform is older, dating from the mid-1990's. But in 2000, Microsoft introduced the .NET Framework, a new platform with a Java-like language (C#) and associated development tools.

As of 2007, the Java platform and the .NET framework have been competing vigorously on the desktop, but especially in the area of server technology. Many software developers (programmers) become expert on one or the other, but few have time to learn both. The schism of understanding the two platforms has been widened due to misinformation and disinformation, with a fair amount of zealotry on the part of each system's defenders.

From a historical viewpoint, the two systems may be seen as having different goals. A primary goal for Java was to enable a program to run on several different operating systems; this was accomplished by providing implementations of the Java virtual machine for all prevalent operating systems, including members of the Unix family, Linux, Mac OS X and most versions of Windows.

Microsoft has been widely criticized for only implementing its .NET runtime "only on Windows." Such criticism does not take into account that Windows is not a single operating system (at least not from the viewpoint of a programmer who must call routines in the operating system). Even before Windows Vista appeared in 2007, there were already approximately 35 versions of Windows, all with slightly different application programming interfaces (API's). The difficulty of developing software for these many different Windows systems had led to a situation called "DLL hell", where the wrong versions of dynamic link libraries (DLL's) were encountered by programs trying to run. Creating the .NET framework solved this huge problem for Microsoft by making all versions of Windows alike to programmers. From the other side, Java also has been always available under Windows as well, equally isolating the programmer from specifics of the current Windows version and providing its own solution for this important problem.

In fact, some .NET programs can run on non-Windows platforms. Miguel de Icaza (co-creator of GNOME) has created an open source implementation of the .NET framework for Unix-like operating systems; it runs on Mac OS X, Linux and Sun's Solaris). Called Mono, this independent implementation of a "common language runtime" is based on .NET's ECMA/ISO standards[1] and is not under the jurisdiction or ownership of Microsoft. From the other side, Java implementations for various operating systems come from the same vendor and are much more comparable with each other both in terms of performance and various subtle behavior inside the libraries. On the contrary, Mono project, while providing .NET under Linux, is a completely different implementation so more issues can be expected when migrating. Java system library is quite large and unified over various platforms when .NET offers much smaller standard library with multiple extensions that may or may not be available under different implementation of .NET.

The .NET framework and the Java platform have diverged in various other ways, including that .NET was designed to allow many different programming languages to use its runtime and libraries (whereas the Java platform was not used for multiple languages until very recently). There was no theoretical reason for Java being the only language that initially used the Java runtime. It was only since perhaps 2006, in response to Microsoft's multi-language .NET strategy, that Sun finally began a push to get additional languages "targeting" the Java runtime.

Platform comparison

  • Java was the model for Microsoft when it created the C# programming language.
  • Java was designed to be cross-platform; .NET was designed to be cross-language:
    • Java provides freedom from all OS differences (with diligence), by making necessary cross-platform compromises. Java also provides cross-language calling via JNI but it is too complex for free and frequent language mixing. JNI is more suitable for accessing OS or hardware features that are only reachable from C.
    • .NET makes dozens of versions of Windows alike for programmers; it eliminates the "DLL hell" which formerly occurred when installing Windows applications. However this important-by-itself feature does not create a big difference, as Java under Windows also provides the unified runtime environment.
    • .NET libraries can be used by any of the .NET compiled languages (of which there are dozens); libraries can be written in any .NET language. Java's native interface was originally restricted to C and C++.
  • the two platforms compete fiercely in the world wide web
    • JSPs are usually used with Apache web servers (Linux or Unix); these are HTML interlaced with code, that when called are compiled to Java Servlets. However the JSP engine can also run on its own on various platforms, including Windows.
      • called "servlets" if all code
    • JSP's can utilize normal java code via a 'include'.
    • ASPs require Microsoft's IIS6 web server; these are HTML interlaced with code
      • called "web handlers" if all code
    • both Linux and Microsoft web servers use load-balancing across mirrored web farms to scale up
  • so-called "dynamic" languages such as Ruby are seen by some as the next stage beyond Java and .NET
    • Both .NET and Java now run Python and Ruby through Jython, JRuby, IronPython and IronRuby.
  • Following Tiobe index, Java currently seems more popular so Java specialists may be easier to find.

Java VM Languages

Several different languages have been ported to run on top of the JVM, since about 2006, with a wide variety of programming styles[2].

  • Java
  • Python, via Jython
  • Ruby, via JRuby
  • Scala, a high-level language with a highly sophisticated type system
  • Groovy
  • Clojure, a LISP-like language
  • Rhino, an implementation of JavaScript
  • JavaFX, a new declarative language to define the user interface.
  • IDL (works with built-in CORBA engine)

.NET Languages

A great number of languages have been ported to run on top of the .NET virtual machine[3]. Some of the well-known languages include:

  • C#
  • VB.NET
  • ASP.NET
  • F#
  • C++
  • Python, via IronPython
  • Ruby, via IronRuby
  • IronLisp / IronScheme / L# are all LISP/Scheme implementations on the .NET platform
  • JScript.NET implements JavaScript on .NET

See the List of languages using the .NET Framework for a more exhaustive list.

References