Matt Hughes asks:
"When does one programmer's preferences (Java over Microsoft-anything because they hate Microsoft, or Microsoft over open-source because open-source is evil) and the variety of choices start to erode productivity? As a J2EE developer for the past few years, I admit that I've become frustrated at the number of choices out there. Every one offers a different way of doing things but they don't all interoperate (JBuilder doesn't natively understand Struts) and none of them -- in my experience -- pulls all of the web technologies together very succinctly. Does Visual Studio .NET and the .NET framework pull this together better than the open-source projects out there, or is it just as complicated in your experience? Is .NET too immature to be trusted? What are your thoughts?" For those interested in the raw performance numbers, Slashdot did a
performance comparison between the two technologies, in an earlier article.
"I've recently been asked to produce a report listing the pros and cons of J2EE and .NET as a web application development platform. I've been using J2EE for years now and haven't even touched .Net as I dislike most Microsoft products. However, for the report, I am trying to be objective. From my own experience and from what I've read, it seems the defining issue for some people is choice.
As far as language preference, some argue Microsoft allows too much (VB.NET, C#, and supposedly everything else *eventually*) and J2EE too little (Java). As far as development environments, Microsoft offers too little (Visual Studio .Net, Windows Server 2003, Windows only) and J2EE
provides too much (JBuilder, Eclipse, Tomcat, JBoss, Websphere, any OS/hardware combo, etc)."
JBuilder has support for Struts. 8 even has rudimentary support for 1.1. 9 has full support as far as I'm aware. Eclipse can also use plugins to have that support, but I haven't used them personally. I don't see what there is to complain about in J2EE development environments...
Daniel
Carpe Diem
Believe it or not some people use Java for reasons other than hating MS. Some people use MS for reasons other than disliking open source.
Having said that, I do note that you are perpetuating the myth that Java runs on "any OS/hardware combo". This is untrue of any language but I suspect "C" comes closer to achieving it than Java.
I think everyone suffers from the Maslow Hammer syndrome. We all prefer to use the tools we already know. This is not an entirely wrong attitude, since anyone is more proficient with the tools used regularly. The Maslow Hammer syndrome is dangerous only when its threshold is so high it prevents changing to a tool that is much better. This is not the case for either of J2EE/.NET. If I changed to .NET now, I'd take a few months to develop as fast as I do now in Java.
If at first you don't succeed, skydiving is not for you
I haven't coded neither Java or C# much, but I know the basics for both of them. C# to me seems a bit clearer and easier to get a hang on than Java. I also like the fact that I can code in C#, Smalltalk, Eiffel, ilasm (yeah right;)) or some other language, and if a Visual Basic programmer want to use my classes (s)he can just use them, like they were native classes.. No modifications needed. No wrappers needed.
I haven't done any testing on raw performance, but I have noticed that running "mono app.exe" starts the app almost as fast as a native app while Java takes WAY more time to start up.. Also, Java seems to have much more RAM overhead..
My other account has a 3-digit UID.
I think letting "I hate Microsoft" or "I hate open source" sway your decision is unprofessional (besides -- do people really hate open source? I don't even think Bill Gates *hates* open source, he just wants to keep his market share). Rant and rave one way or the other on Slashdot all you want, but make your business decisions based on facts. There are plenty of pros and cons on both sides.
.Net than open source in general, I'll get to the point.
.Net (C# in particular), and a lot of general development. From this limited perspective, here are my observations:
.Net. Both have roughly similar execution speeds (both have decent JIT engines under the hood). Most performance differences in benchmarks will probably be found to be due to the quality of the benchmark code or the quality of the libraries (such as database drivers) being used. I know that Microsoft has gone to great lengths to optimize their database drivers, and a while ago some benchmarks were posted that showed some significant advantages to their drivers. Perhaps Java has caught up since then -- I don't know.
.Net only has one decent IDE, and some people don't like it, but it gets the job done well. There are side utilities that fill in any gaps left. I don't have as much experience with Java IDEs, but I'm sure they are also decent, but that there is no one single IDE that makes everybody happy. Since most workshops have to pick one IDE for the team to agree on, somebody is going to be unhappy no matter what, just like some people might be unhappy with the Visual Studio IDE.
.Net supports multiple languages, but I suspect that most workshops will only make heavy use of one or maybe two. It just gets too complicated otherwise. The nice thing is that no matter what language you pick, you can access the same support libraries. But the more important question is which language is better for your purpose -- Java or [whichever language you decide to use].
.Net hasn't been around as long. And whi
Variety can definitely erode productivity. At work, I have to keep up on the Win32 API, the Windows CE API, C++ (with ATL, MFC, and STL), C#, Perl, 2 variants of SQL, makefiles, with some VBScript and JavaScript thrown in for good measure. At home, I try to keep up with the FreeBSD API, 2 more variants of SQL, PHP, Java, a different structure for makefiles, etc. And the alphabet soup doesn't seem to be getting any better.
Open source seems to have a tendency to have several projects around a given problem (MySQL, PostgreSQL, FireBird, SAP databases), while businesses tend to lead to bigger, more fully featured (also called bloated -- depends on your point of view) products (SQL Server, Oracle, DB2). Performance varies by application -- for jobs that don't need the extra features, sometimes the simpler products are better. And sometimes, open source results in a real beast (Mozilla). Java is somewhere in between I guess. But since the question was more about Java vs.
I haven't used Java much for web apps, but I have done some general development in Java. I have done some web development with
The performance benchmark you linked to was pretty meaningless. It seems to have been funded by Microsoft, so that just might have biased the methodology a bit. Nevertheless, I think there are some general gut feelings that I think are reasonably accurate regarding the performance of Java and
As far as IDEs go, I'm not sure why "choice" in this matter is really an advantage.
As far as language goes, I guess it is nice that
I personally like C# over Java. Things like ref and out parameters, boxing, and attributes are things that are quite simply missing from Java. They are needed, and they aren't there. Obviously Microsoft took a lot of good ideas from Java, but since they got to start over with it, they got to improve on the parts of Java that drove Java programmers nutty.
On the other hand,
Time flies like an arrow. Fruit flies like a banana.
I have using both. The difference is not big. The only reason why i would choose .Net is that i am using MS only. You know that your not gonna move to solaris or mysql or anything else. I know its working but .net on windows is better that java on windows. So if you arent sure if you gonna use windows/exchange and so on - stay with java.
Several times recently we have had opportunities to have contracts with public shops, like governemental agencies and the like.
.NET, microsoft, sqlserver, licencing ??
They all sent us loads of papers describing what type of architecture they expected, and what rules we'd have to follow. What they all want to ear is : open standards, evolutivity, free (as in beer) libraries, maximum portability, and connectivity.
Now, guess what they like to hear between J2EE, jakarta libs, JNDI, linux, or...
It seems big shops really start to get the point about the advantages of open standards.
(Note : I'm talking about french agencies, it might not be true everywhere. But I suspect most european countries are following those lines too.)
Windows XP really impressed me. With that and having heard of J#, I thought wow, that'd be great, because I like Java, but it's too irresponsive for GUIs and even though hand-coding GUIs makes nice code, I don't like it (using Eclipse for java). So I got a copy of VS.Net from campus, which goes for not so much.
.Net by itself, you also need a redistributable for J#, which isn't installed in the computer labs. Deployment is also very complicated. You have to distribute the .Net and J# distributables along with your app, then if you want DB support, you need a third one and then your app by itself is already big...
.Net.
.Net from my pocket because I wanted to use it and at the end, the only thing I can say about it is that I got robbed. Eventually, it will mature up and if it gets accepted as well as Java, it might become interesting. But next time around, it's gonna be forced on me, I won't switch by will.
At first I thought it was damn cool. You could just build your GUI very quickly by clicking around, the online help is nice and all, multi-monitor support is really good, etc. Then bugs started popping from everywhere and I found I was spending more time on writing workarounds than "real" code itself (or simply redoing dialogs because the IDE decided to forget about some). Then, when I had assignment demos to do for school, I was writing them in J#, but I had to redo the GUI by hand anyways, because you can't run J# on
So I just switched back to Java, where you just install one distributable sometimes, for machines that don't already have it. And then deployment is a joke, you just send a 50k jar and that's it. No 2-3 megs for simple apps! Sure the GUI's not too responsive, but I'm waiting for 1.4.2 eagerly now instead of wasting time on
I payed
First, familiariarity breeds increased effency. If you don't have the time to study all choices and train on something new then pick a familar one.
.Net is younger and has fewer choices when it comes to web framworks and external libs which some people prefer. This blog enty explains it better than I can: http://javablogs.com/ViewEntry.jspa?id=31449
Java is more of a Language For the Masses than C#/.Net. While us alpha-geeks like Languages For Smart People that does not make them better, espcially when we have to work with less smart people on your team. Much more on this at: http://madbean.com/blog/20/.
An even better than both of those two crapper products and older. Faster to build and faster to depoly.
The choice between .Net and J2EE is a cultural one. Many companies would rather have one solution, even if it limits them in many ways. Others would rather have more flexibility, even if it means more work (learning how to use struts and JBuilder together).
.Net isn't easy to use on accident. Each company chose their strength and built around it.
J2EE technologies aren't flexible by chance and
(No wonder they're so far behind on submissions, they're all busy in Slasdot Labs (TM) running the latest round of amazing new benchmarks. I can't wait to see the results!)
Slashdot quality declines as the number of hot grits posts decreases. - Provolt's Law, Apr-09-2005
I just did a security update on my wife's laptop. That machine uses Windows 98, but doesn't actually include .NET (at least, I never selected it for download).
.NET.
.NET, because I do not have a license, nor have I agreed to the EULA.
.NET and agreed to the EULA, then you are under a gag order from Microsoft. Unless, of course, you have a Microsofts permission. In which case you are a shill.
The last Microsoft Update included a paragraph in the EULA, that indicated that you may not mention any benchmark comparisions about
I presume that this includes performance and usability (no mention made of that in the EULA). Now, my wife agreed to the EULA (She must agree to the EULA, so I am not bound by it). Anyway, I have never used
But, I do take these things seriously. If you HAVE had exposure to
Now, the SUN license doesn't have such a clause, so you are free to comment on performance 9or lack thereof). So, make comments about J2EE, its performance and its usability.
Ratboy
Just another "Cubible(sic) Joe" 2 17 3061
Okay, here is my anti-disclaimer. I _AM_ a web developer, and I do web development all day long, every day, since there was a web pretty much.
.Net model encourages a better web architecture (IMO).
.Net solution performs better. So thats 1. The Java code might be more "correct" OOP design, but in terms of maintainablilty, mediocre code, vs 4X perfect code is gonna be a close call. And I don't think the .Net code is mediocre, its very readable. And the Java code isn't perfect. So in my book, .Net wins the pet store competition.b
.Net (specifically C#). .Net has a problem of swallowing exceptions. In Java you have to declare what any function can throw. Therefore the caller of your function can know to handle the error, pass the error, or ignore (swallow) the error.
.Net is a reality too.
When JSP first came out, it was a significant step forward from the tool that I was using at the time, ASP (classic). The advantages were many. Exception handling, and objects were the primary ones. Other things (like being strongly typed) also were a significant step forward. Yes you could get many of these things by doing your ASP development in JScript, instead of VBScript, but nobody really did.
However, the disadvantage of Java : over-architected. If you follow the blueprints, or examples provided by Sun, or Apache, or any other big shop out there, you end up with thousands of classes. Java itself doesnt have this issue, (IE, the language does not require this) its more of the paradigm that the whole J2EE world evokes.
ASP.Net has many of the same advantages that JSP has. Exceptions, classes, strong types (if you want them)
However, as a bonus, the
For example, take a look at Java Pet Store vs PetShop.net. Yes there are complaints from the Java world that its not a fair comparison, because they did things differently. THATS THE POINT. If Java encourages you to do things in a way that uses 4x the code, and runs slower, thats a problem. Microsoft is under no obligation to do things in an inneficient manner to match Java, because thats what Sun wants. MS set out to compare "how much code to make this functionality happen, and how does it perform"
Some may say : but the Java code might be better architected! How do you judge architecture? Only 2 things matter. Maintainability, and Performance. The
Now, from a platform perspective, Java did some things that I wish would have made it into
Since you dont declare exceptions in C#, callers of functions have to be prepared to handle any exception. As a result, most callers just end up catching Exception and then they never get passed up.
Some other things are enviromental. Visual Studio.net is FAR AND AWAY the best IDE I have ever used. Seamless integration of HTML, code, Javascript, database etc. Integrated debugging of client and server side code, including database calls (it will jump into the stored procs and let you step through them!)
While integrated debugging is something available in Java, I have not seen it to this degree.
Also, ASP.net seems much easier to extend. Making new controls (user controls or server controls) is trivial compared to the work required in Java.
Now, Java's big claim to fame is of course cross platform compatibility. If you need to run on Unix TODAY, then obviously go with Java (or python, or perl or whatever)
But Mono is just around the corner. Mono will already run iBuySpy (a pretty complex app) without modifications. So cross platform for
I'm a little concerned at the way the question conflates open-source with J2EE. Java can be used in an open-handed fashion but it is not inherently open. Certainly J2EE is not though JBoss gets props for trying.
Anyway, why take the pill? If you don't like the infrastructure, build and borrow the tools you need. It's not rocket science, as much as MS wants you to fear its complexity. A decent controller and a quality markup regime and you can do *web services* as you see fit on top of Tomcat.
illegitimii non ingravare
The two technologies are really targeting different markets. J2EE is really aimed at large enterprises. As such, it was designed primarily for scalability (not performance). That means lots of layers, etc. so that they can be put on different machines and clusters and stuff like that. This makes J2EE more complex as well but once you learn it, you can do more with it. J2EE application servers also do a lot more for you than Microsofts application server technology. .NET (as with all MS software) is really aimed at the small to medium sized enterprise. MS is focused mainly on making their stuff easy to use. So the learning curve isn't as steep, but once you start building more sophisticated applications, .NET is not as flexible.
.NET. Visual Studio is really easy to use. While the Java folks have spent the past few years focusing on refining the technology itself - tool support has suffered. However, that will soon change - Eclipse and Netbeans are coming along and Sun will soon be releasing new easier to use tools.
.NET. You will be locked in if you use it. Mono is coming along nicely but do you really think that MS will maintain compatibility with it in the long run? Given their history, I seriously doubt it. With Java and J2EE I can setup complete development and production environments without paying a single license fee. There is also healthy competition in the J2EE app server market so if you are using Websphere and IBM pisses you off, you can dump them and switch to BEA (with minimal porting effort).
Tool support is the biggest draw to
You also cannot ignore the proprietary nature of
Like you, I've also had to evaluate both technologies (I work for an enterprise consulting firm) and believe that J2EE is the way to go. Initially, it may cost more (if you use the proprietary software) but it is worth it since you have far more control over it and more options.
I've worked with both platforms for years now. .NET is definitely matured, it's simply the next logical step in the evolution of VB, ASP, and MFC, although somewhat hybridized now. Depending on your preference, it may be quicker to develop in Java, as C# is just as much if not more effort. But VB has finally matured into a respectable language, and provides for truly rapid development. And for all you JavaBean lovers, stop wasting your time. Visual Studio .NET is definitely a good match for its competition, and .NET provides "components", which parallel beans, and make more sense IMHO. Oh yes, and then there's web services. Did I mention it all runs on Linux?
I have used both a fair amount. My previous job was writing Java business web applications, and I am currently managing the development of a C# webservice (for the server) and a C# winforms client.
.NET and J2EE, though they are less similar than the language comparison.
/ideal/ for any application dealing heavily with either protocol. In fact, I would say that it is nothing short of brilliant.
.NET calls 'AppDomains'. This is a very powerful feature.
.NET/C#.
/platform/ maturity, but I will leave the zealots to argue Windows vs Unix.
.NET and C#. When Mono gets further along for web services, it will certainly be a force to reckoned with. As for writing webservice and database clients for Win32, it is really quite nice. You could use GTK# and have it cross-platform, yet still take advantage of features that C# includes.
...and the cons: currently somewhat locked into MS' platform (though this should change shortly with Mono), somewhat inferior auto-documenting to javadoc.
Let's start with the picture from 10,000 feet: C# is aimed squarely at Java, and for all intents and purposes, it is a superset of Java. Similarly for
Language Differences:
C# has less integrated threading support. (which is a bad thing, imho)
C#'s XML and SOAP integration make it
Java's XML integration is a nightmare. JAXB is the only thing that comes close to being halfway decent, and it still doesn't come close to the integration C#. XML serialisation in C# is fast and beautiful.
C# gives you far more control over the dynamic reloading of classes, as well as increased security through what
C# documentation isn't quite as nice or refined as the standard javadoc fare, but MSDN is a pretty nice source, though sometimes you have to look a little harder or deeper than you would with the javadocs.
In general, both APIs are very clean.
As for maturity, I don't really think that's an argument. Most of the Java technologies available now (especially the XML/web services bits, in which the competetition is most fierce) are no older than
I think the larger question is the underlying
Do you feel comfortable locked into a Microsoft platform and x86 hardware? Personally, for a server, I don't. Go help out Mono, which is progressing nicely, but could definitely use some more help. (http://go-mono.org)
If you do, I would definitely go with
In short, the pros: excellent XML and SOAP handling, speed, many small features which are currently emulated at the API level in other languages
Simplicity is prerequisite for reliability. - Dijkstra
I'll give you the fact that integration is probably easier with M$ since you don't have the plethora of choices you have with Java, but once installed (a trivial task), they are a snap to use, including "XML serialization", (although that doesn't really even seem much of a test of an XML parser, with the competition within the Java world, it usually revolves around which parser is the fastest, has the smallest memory footprint, best supports the XML standard etc. Again, a non-issue if you're stuck with one parser.
So I'd conclude, you're probably seriously limiting yourself with M$, however, there is the no hassle benefit of not having to go and install stuff etc, sort of like using IE because it's right there, users don't have to download something off the net to use.
Also, .NET/C# - it's a Java clone alright, but it's a subset being limited to a specific OS, unlike Java. So it's kinda like Java for Microsoft boxes. MONO? I find it very hard to believe M$ will let Mono get past the training wheel stage. Nice idea though, but hey, this is M$, not some charity.
If there is a way, I am not familiar with it (other than getting an assembly as a file and loading it).
Java's classloader structure, built-in URL class loader, security and flexibility of dynamic classloading is incredible.
this is .NET vs. j2ee, okay?
i on .NET:
.NET instead of JDBC -- ADO .NET has a better API IMO, but both are pretty simple
.NET is better than JSP (hit, ASP .NET is NOT ASP , its ASPX). You can mix the code in if you want, but you don't have to.
.NET doesn't have that, has web services instead. Web services are very nice, but everything gets converted to XML, so its slow.
.NET has "datasets". I like datasets, but have never coded the beans. Entity beans are crappy, from what I've heard, transient beans are OK. Datasets are pretty amazing, lots of code already built in.
.NET in productivity
.NET licensing scheme -- its very complicated and prone to error.
not Java vs. C#and which is more productive, allright?
J2ee:
Servlets
JSP
JDBC
Transactions
RMI
Reflect
Java beans
- no servlets, 1 for J2EE, on the other hand, there's no need for APP SERVERs
- ADO
- ASPX vs. JSP -- JSPs get really ugly really fast, ASPX does a better job of keeping the HTML and Code separate (the notion of code behind) -- again, ASP
- transactions, I haven't used those in J2EE , only in JDBC,
- RMI,
- reflection -- both have reflection, it works, even score.
- beans --
I give the edge to
1) the IDE is far superior
2) microsoft has more experience with business applications: what does Sun know about business applications? they make boxes
3) you don't need a separate app server/servlet server/J2EE compatible bean server etc., it already in IIS.
I agree with complaints about the
>> Oh and one more thing: C# doesn't check the exceptions. I may be a purist, but I just detest that. You have to document, maintain, and generally keep an eye out for your and the system's exceptions all the time (of course sometimes you have no idea what system exceptions there are..)
I think this gets especially fun when using 3rd party/closed libraries, where you don't necessarily have any idea what exceptions they might throw.
In practice, I have not found it to be a big deal. Then again, i'm pretty anal about exception handling due to experience with Java...seems like it *should* be easy enough for MS to provide this type of checking as a compile-time option....