Advantages Of .NET Over Java
ansonyumo writes "ZDNet is carrying an article written by one John Carroll that outlines specific advantages of .NET over Java. It's written from the point of view of a Java advocate who has 'seen the light.' First of all, comparing .NET and Java isn't very fair; you have to compare .NET and J2EE. When you level the playing field, most of his arguments readily fall apart."
when you compare to the correct language structure, so what? What's important is PHB's will probably be reading articles like that, and will point to said articles in justifying going with a microsoft centric language (along with IEEE, ECMA standardization, etc.) The article simply underscores that a wide and varied skillset is what's going to keep a developer alive in today's environment. Sun's not exhibiting the best of business decisions lately, and if they want to stay afloat, they need to come up with someone to answer .Net effectively in popular media. Posting articles on slashdot saying "look at this! it's not accurate!" isn't a great way to promulgate usage of your favorite language either...
Mono is not complete. It is not even yet comparable to the "Shared Source" version, which is less complete than the windows verison.
.NET, and only then with C# on BSD, it's pretty obvious that a lot of the standard library was designed around COM and Windows in general. Many parts of the standard library are crippled to the least-common denominator of the .NET platform: visual basic. What does this mean? No interoperability with unsigned data types, for one.
.NET is completely false. They have these things called "netmodules" which are just that, as far as I can tell. There is very little documentation on the subject.
.NET is an "open" platform are for the most part just false.
Though I've had limited experience with
Incidentally, the article's claims that there are no equivalences to ".class" files in
To finish ranting, any claims that
See you, space cowboy...
Will system designers go after M$'s stuff after what M$'s attitude and history in the past 10-15 years been. I mean M$ proved that it does not seek best performance, is not after user's intrest, does not care for for service. It cares for the greens. In the past few years they did a lot of stuff that made it clear now that they were putting us in a box that can stick us to use there products only(with no respect to its quality)
/*Why is there a penguin on my desktop?!*/
so the real question is are you willing to go through this again?
The lunatic is in my head
I don't do a lick of Java or
It's only available for x86 computers that run Windows.
No mainframe support.
No cluster support.
No Solaris,Unix,*BSD,OS/2, Win95, Mac 9, Mac X, AIX, IRIX support.
No Aplha, SPARC, PowerPC, Motoroal 68xxx suport.
So sure,
* parts of the
Moneyed corporations, non-working 'poor' and criminal prisoners are turning productive citizens into tax-slaves.
A lot of this is basically a load of crap. Plenty of people use XML for configuration issues. I personally still use text for most of my config files, just because it requires simpler and easier code.
And all of the default configuration files in J2EE ARE xml. web.xml,ejb-jar.xml, whatever.
Also, what's so great about having your "system wide " xml parser? In my world, you specifically don't create environment variables for your XML jar's because that makes it a common resource and creates conflicts. What if you want to use a different parser and both parsers have a class called XMLParser? How does MS deal with knowledge of which is which. J2EE servers (for the most part) simply provide application level resources (WEB-INF/lib and WEB-INF/classes) and server-level resources (app-server/lib).
Next: Metadata: XDoclet provides this ability and a lot of people use it. More importantly, it's not tied. You can use your own system.
Next: I honestly don't know enough about assemblies, but it does look like there are some cool things in there. I have to admit, CLASSPATH for Java can be clunky. However, JAR/EAR/WAR is pretty good stuff, and does most of what people need.
Next: The remoting issue is a non-starter. The protocol is really up to the vendor, and some vendors provide proprietary, somy RMI/JRMP, some strict RMI-IIOP. SOAP also changes some of this (no advatages to either side).
So blah, for the most part.
--Stupidity is Self Curing!
I don't necessarily agree with the article itself in some points, but I can't see how the comparison is "unfair" because it's not being made to J2EE but the Java 'platform' (Sun's words, not mine) itself. C# vs. Java would be a completely different thing, but that would be based on the features of the language and the runtime library. J2EE is just an extension of that.
I've used Java longer than the reviewer -- since it was an alpha. I still use it and am an official participant in the JCP. I plan to continue using Java, probably for years to come.
.Net, though .Net's have the benefit of learning from Java's mistakes. (A nice, consistent way of converting between fundamental data types, well-designed containers, etc.)
.Net classes) have over Java. All the anti-MS bigots don't make that easy, though.
That being said, I find the C# language to be significantly better designed than the Java language. Things like delegates are a great improvement over interfaces. When Anders Hejlsberg was still at Borland, he tried to persuade Sun to use them in Java instead of the interface approach and they just blew him off. "Syntactic sugar" they called it, and then they went ahead and implemented their own syntactic vinegar. I'll take the sugar, thank you.
Using "properties" in an OO language is a natural.
a.b.c++ calls a set() method instead of directly accessing a member var named c. (The c property may not even be backed by a variable. It may be calculated on demand.) In Java, to use OO methods instead of exposing private variables, you would do something like
a.getB().setC(a.getB().getC()+1);
although usually it would be broken into several simpler steps with temp variables for ease of reading.
C# makes it a breeze to create visual interfaces to object properties without losing the encapsulation of the implementation of those properties.
There are so many other improvements in C# relative to Java that it really annoys me to hear the political refrain "C# is just a knock off of Java". It's such a superior "knockoff" that, for the first time in years, Sun has gotten back in the mode of making language improvements (all of which make it more like the "knockoff") instead of their knee-jerk "you're not language designers so, trust us, you don't need that" reaction of the past.
The Java class libraries are far more complete than those of
I now find myself in the position of using C# when I can (mostly for personal utilities) and Java when I must (for professional production). Since I strongly prefer to use Linux servers and strongly prefer to avoid the MS license ball-and-chain, I anticipate having to continue using Java for years.
While doing so, though, I will continue rooting for Mono and working thru the JCP to try to steer the Java language to embrace and extend what I consider the significant advantages C# (and to some extent the
"Those who have never entered upon scientific pursuits know not a tithe of the poetry by which they are surrounded."
I don't find #1 persuasive. If you want XML in Java, you use XML tools. Properties aren't XML, they are properties. They SHOULD be simple as in my.properties.property2="bingo" . If you want XML, just use XML. Java has the best XML tools of any language there is.
.Net has only archives. How is this better?
.Net doesn't meet this requirement and basically isn't usefull to me.
#2 is OK, but if you can find the methods, you can find anything, so what is the advantage?
#3 is just odd. Java has jar, war, ejb-jar, etc... archives and also has classes by their lonesome.
#4 is a joke. RMI is cake if you can rely on the OS being the same. The hard part is cross-platform, not cross-language RMI. This is still a problem which java solves well and in multiple ways by relying on open standards (surprise) which explains why it is the dominant language for enterprise computing and middleware. I want a language that I can write code for and be assured that I can deploy that code in a client app on Windows or Mac or Linux, in a web server running windows or linux, and on a data tier box running Unix or Linux.
I understand the aversion the Java designers felt for "syntactic sugar". They equated it with the spiral of Perl into syntactic chaos.
.Net runtime made a lot more effort to include features in the bytecode system that will enable languages to use generics, multiple dispatch, multiple inheritance, tail calls, and others, which could support more interesting languages (or new C# features) in the future than may be practical with the JVM. (I'm not an expert on that last point, so consider it a *rumor*).
I understand it, but don't accept it. I think that the best programming language is the one that makes you tell the computer the fewest number of things to get it to do exactly what you want it to do.
I think the Java designers were way too conservative about syntax and way too conservative about incorporating popular, proven features from other languages. They should have had smarter enums than C++, not no enums. Smarter function pointers than C++ (delegates, for example) instead of no way to pass a single function as an argument, etc.
And more syntactic sugar of the sort you see in Python and Ruby.
Java is a very solid, valuable production platform as it is, but I think Java would be a better *language* if it were a little more like Python and less like a simplified C++.
Of course, I could say the same about C#, which obviously didn't want to venture too far from the familiar features of Java, C++, and VB. My understanding, though, is that the designers of the underlying
"Those who have never entered upon scientific pursuits know not a tithe of the poetry by which they are surrounded."
"enterprise level... I wonder if Java is ready for prime time. One of our departments has to restart their Websphere environment 4 times a day to keep it running. We haven't seen those problems with our .Net deployments. "
.Net even dreams about. If you have to restart websphere 4 times a day then obviously you have done something wrong.
... hmmm ... choice.
.Net won't make your app any less poorly architected.
Websphere runs more enterprise critical application installations than
And you know what? It only highlights the J2EE advantage. Don't like Websphere? Try Weblogic. Ohh Weblogic is too expensive? Install Sun One off your Solaris disks. Don't want the all-Sun lock-in? Download the free alternative JBoss. Can't figure JBoss out? Try and look at the Oracle 9i app server. Don't own any Oracle licences? Go and buy Macromedia JRun.
Now what hardware shall we deploy it on
And so on. Your app should run on all of those, unless your app is so poorly designed it won't run on any. But that's *your* problem and converting to
-A lovely little thinker, but a bugger when he's pissed-
#1 Java also has XML serialization.
.NET in this respect,
#2 You can also introspect bytecode. Admittedly,
it is not as well-developed as
but there are no inherent limits.
#3 I could not care less about, so no comment.
#4 For cross-language, use CORBA. Java makes it
trivial.
-I like my women like I like my tea: green-
instead of moaning about how long it is taking to get mono up and running, you should be helping.
I would love to work on an awesome project like mono if I had the time. Right now I have a full-time job, I've been hacking on my own project for 2+ years, and I'm working on another little side project. Beleive me, it's not like I sit on the couch every night wondering when the mono-team will get their asses in gear:)
One statement in the article stands out as inaccurate or misleading. You can run multiple versions of an assembly, but not if you want to dynamically load and unload assemblies. If you want to load/unload assemblies, you have to use a different appDomain for each assembly. This way you can unload an assembly by killing the appDomain. The problem the author describes is well documented and part of many Java specs. Specifically the servlet specs explicitly require each webapp have it's own class loader for that reason. I would argue having multiple versions of an assembly or jar file within the same app domain or classloader is not a clean solution. It is better to isolate versions in individual domains.
This way, you completely avoid the issue of collision and provide cleaner separation. But that's my own bias. there are still tons of stuff