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."
In closing, C# .NET > Java.
Please address .NET hate-responses to /dev/null
Your windows environment has /dev/null?
How cool is that?
They can take my LifeAlert pendant when they pry it from my cold dead fingers.
Yes. It's c:\.
I read TFA and all I got was this lousy cookie
As they are the harbingers of the new age, post dotcom world, where overspecced hardware fixes everything, where there are legions of entitled douchebag "developers" who took a certification course, and of apps which can't run in less than 8GB of memory (our resident BOFH hung up on our developers when they asked for a 64GB VM because they kept getting OOM errors in Java).
In short, both languages rode the crest of the cultural revolution where it is now OK to suck, to offshore code development with no expectation of quality coming back, of "agile" methods where your next version is always going to be the stable one. I'm not exactly saying that these languages CAUSED any of this, but there is at least a temporal correlation.
Yes, I am a Unix guy, and yes, I have grey hair.
I want to delete my account but Slashdot doesn't allow it.
Microsoft also had the benefit of Java going first and making all the mistakes, and then Microsoft got lucky when Java lost its first-mover advantage chasing down several blind alleyways -- "Applets", Sun's mismanagement, a bureaucratic open source strategy.
Don't blame me, I voted for Baltar.
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
I am both a professional java and C# developer. Each one has their advantages:
On the C# camp:
* delegates and events
* functional constructs
* automatic variable types
* LINQ
* Value types (efficiently allocate thousands of value objects in an array, you need some really nasty workarounds in java)
* Generics that keep their types at runtime
On the java camp:
* Spring (There is Spring.Net, but lets be honest: it does not compare)
* Collections library (much more complete and better thought out than C#'s)
* Maven
* J2EE
* A million other libraries freely available, that do _anything_ you want.
* Portable to more platforms (Mono sometimes leaves something to be desired)
So in my humble opinion, C# is much more complete as a language, but java has much better libraries and community. So which one would I pick? well, it depends on the project, the platform, and the amount of code I can reuse from open source libraries.
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*
Microsoft has also had the benefit of Anders Hejlsberg being the lead architect, one of the best minds in the industry. There are maybe a handful of people in the industry today that can stand at the same level as him, and none currently alive that can stand taller. Hiring him away was a major boon to Microsoft and a crushing blow to Borland.