Java API and Microsoft's .NET API: a Comparison
Nerval's Lobster writes "Previously, developer Jeff Cogswell focused on the respective performances of C# and Java. Now he's looking at yet another aspect of the languages: the runtime libraries—what exactly the libraries are, how they are called, and what features the languages provide for calling into them. Examining the official Java API (now owned by Oracle) and the official .NET API owned by Microsoft, he finds both pretty complete and pretty much a 'tie' with regard to ease-of-use and functionality, especially since Java version 7 release 6 allows for automatic resource management. Read on and see if you agree."
C# was the direct result of MS being blocked from using Java,
No, no it wasn't.
It was that Sun owned the standard and told Microsoft to quit violating the standard or call it something else.
Sun sued and won in court, because they were right.
If the situation was reversed, I'm sure you'd be saying Microsoft was in the right for defending C#.
Microsoft was always free to use Java and write their own version, as long as it conformed to the standard. But Microsoft being Microsoft, "standards are for pussies."
--
BMO
There are ciritical fixes released for the .net API every so often via windows update. Neither are flawless in that regard.
True, neither is flawless.
But one of them appears to have been considerably better designed (or better QC):
.NET 4: 34 vulnerabilities Released 2010-04
Java 1.7: 216 vulnerabilities Released 2011-07
or the previous incarnations:
.NET 2: 53 vulnerabilities Released 2006-12
Java 1.6: 432 vulnerabilities Released 2006-01
Java experiences 6-8 times the number of vulnerabilities, even over shorter time frames.
Reading slashdot one-liner: (irm http://rss.slashdot.org/Slashdot/slashdot).rdf.item | fl title,desc*
No, they weren't blocked from using Java.
They were blocked from creating their own non-standard Java.
Because Sun owned the trademark and the standard. Now owned by Evil Larry.
You can create your own language and API, but you can't call it Java if it doesn't meet the standard. How difficult is this to understand?
Poor persecuted Microsoft.
--
BMO
While Mono allows C#, it does not turn .NET into a cross platform executable environment. Practical programs using C# and .NET are tightly tied to Windows capabilities. Since C# isn't a standardized language, and Microsoft doesn't even stick to their own standards with their own products anyway, there will be incompatibilities between Windows .NET and Mono. Mono also does not re-implement all of the .NET framework and is playing catch up whenever there's a new inevitable .NET release. So if you want a cross platform executable system you are much better off with Java.
Basically the whole reason for existence of .NET was to tie the developer to Windows. It was created as a direct response to Java being a cross platform system.
I don't use C#, however last I looked all of its features were borrowed from other preexisting languages, same as Java. Is there something new and Microsoft for once in its life has done something novel?
LINQ is a pretty big deal. I don't know of any language that has something similar. LINQ itself is comprised of a number of language constructs such as expression trees, extension methods, type inference, anonymous types.
Async/await is huge! Right there, MS looks to leapfrog other platforms by allowing developers to create robust, asynchronous programs that doesn't need to spin up threads (or use threadpools) to achieve perfectly composable asynchronous methods.
Dynamic support (statically typed to be of dynamic type) allows the best from dynamic languages to be used from within C#, even interop'ing with dynamic languages and e.g. use an object created in Ruby as a first-class object in C# (or vice versa).
Reading slashdot one-liner: (irm http://rss.slashdot.org/Slashdot/slashdot).rdf.item | fl title,desc*
C# isn't standardized? Someone should call ECMA and ISO then and tell them they've been had.
Java is actually not "entirely OOP based" although it's close enough for most purposes. Example:
17.ToString()
works in C#. It (or the eqivalent 17.toString()) does not work in Java.
In .NET, everything is an object. "int" is another name for Int32, which is a struct (stack-allocated, value-passed object) that inherits from Object and implements a number of interfaces (IComparable, etc.).
There's no place I could be, since I've found Serenity...