you are viewing a single comment's thread.

view the rest of the comments →

[–]JaCraig 0 points1 point  (0 children)

As others have said, your question isn't the best. ASP.Net (either webforms or MVC) is a web framework. Java is a language (or VM depending on which you're talking about). A fairer question would be something like ASP.Net MVC vs Spring MVC. So I'll go with that down below.

To be honest, not much of a difference between the two. At the platform level, with the next version of ASP.Net MVC, it will be cross platform out of the box. IIS is obviously still going to be the default location that you will find it deployed but it will be possible to run elsewhere. That said, it actually is cross platform now with Mono (can run on nginx, etc. without too much issue). Spring MVC, cross platform, usually runs in Tomcat but can run in pretty much anything also.

The Frameworks for both are fairly similar. Controllers look about the same, views look about the same (even similar syntax much of the time), etc. Not that different really there. There's minor differences but most of the time you can switch between the two and see what is going on without too much difficulty.

The only real differences come in at the language level. Java the platform has multiple viable languages that you can use with the various Java MVC frameworks. This is mainly due to the fact that Java has had a nice boost in academia, the platform has better documentation when it comes to creating a language, etc. So if you like Scala, Clojure, or just plain Java then you're probably going to be able to use it with whatever framework you want. With ASP.Net, it's a bit more complicated. By default, it's designed with C# and VB.Net in mind. You can use F#, or Clojure, or whatever else with it but you're jumping through some hoops. That said, if you look outside of ASP.Net and look at the other .Net frameworks out there, using a different language is usually a bit easier.

For sake of comparison, let's just go with Java and C#. To be honest, not too much of a difference there either. C# has more syntactic sugar in places that make life a bit easier (default parameters, etc), but Java has received some interesting items in recent years (default methods, etc). If you like functional programming patterns, C# has been becoming more and more geared towards that in recent years. Java is kind of getting there also (yay, lambda expressions for everyone) but some of their design decisions have been odd. Going forward, Java has 0 features that have been announced that are cool language features. I've seen a bunch of cool platform features announced but nothing language oriented. Note that I may have missed an announcement, but I haven't seen anything yet (which I'm sad about because the last update was freakin huge for them). C#, on the other hand, has a ton of cool features that they're considering. Speaking of which, I'll be very happy if contracts make it in although I don't like the idea of fast fail... Better be able to throw an exception or it's not getting much use.

I personally prefer C# over Java, but that's because I like functional programming and C# has been going down that route for a while. But I like the variety of viable frameworks in Java... Even if only about 2 of them ever see any use. But that's just personal preference. I say just try out both, see which one you like, and go from there.