I had about a decade in both, and really they're two very different worlds. From a code standpoint I'd much rather be in C#. It's one thing that MS has done really, really well over the last 10 years. They've taken a pretty aggressive stance towards adopting new features and although it's become fairly complex as of 4.0 and on, it really has some great features, some functional-inspired things like closures and collections api stuff that reminds me of Ruby in a lot of ways, and a great web framework in MVC that is honestly almost as fun to code for as any of the open source web frameworks out there. If you had to choose between one of the big J2EE stacks and MVC, no question, MVC is far, far better. The infrastructure is still a big 'ol MS GUI world, and I'd rather do <badPainfulThing> than spend a lot of time configuring and deploying IIS apps, but then TomCat and WAR files et. al. ain't exactly fun either.
Java's JVM/bytecode infrastructure on the other hand has undergone a renaissance as a VM platform for a lot of very cool languages: Scala and Clojure being the two big examples there. But that's Really not the same thing as Java, obviously. And there's Android -- a completely different ecosystem, and somewhat truncated as a Java dialect, but still basically the Java language and able to employ most of the libs you're used to having: Guava, Guice and so on. No dynamic code gen, which stinks, but I know why they did it. So if you have Java under your belt and want to get into mobile stuff, that's a huge plus.
So, as a general-purpose language skill, Java is still really, really important to know and will have legs for a long time to come. ASP MVC is a great framework, and if you can't work in something like Django or Rails or the like, it comes in nice 3rd or 4th place in terms of making for general coder happiness. C# is a far more progressive and interesting language than Java, but that's a philosophical difference between the gatekeepers of the two languages: Java intentionally moves slow for the sake of stability and continuity, C#'s minders have apparently embraced a little of the 'move fast break things' attitude of some parts of the open source world. I prefer the latter, but understand the rationale of the former.
Me, I'm a Rails coder these days but also get to hop back into Java for Android dev and the rare foray into ASP work and they all have strengths and tradeoffs and they'll all be around a long time. The only thing I think I would avoid on principle, for my own sanity, is any enterprisey J2EE framework. That truly does feel like a massive leap backwards.
Agreed with this. I used to code C# for a living but have moved on- however, I'm now playing around with MonoTouch in my spare time and I'm loving using C# again.
MonoDevelop is a poor man's Visual Studio, but it's a lot less demanding and runs on OSX. Backend frameworks like Nancy.fx are really great for being even simpler versions of MVC, too.
I was shocked how well MonoDevelop worked out when I used it briefly a couple of years ago. But my expectations were pretty low -- I was expecting a compatibility quotient something close to Wine circa 2001, and got instead a basically functioning C# environment on my Mac, which was pretty dang cool.
I never used Spring as a framework, although I did use it as a general purpose IOC tool, so I can't really speak to that. I much prefer Guice these days if I need IOC for Java. XML config is clunky and heavy and although was a good choice at the time for Spring, has not aged well.
I'm sure Spring would make dealing with beans a lot less painful. I know there's more to J2EE these days than Beans and WebSphere and the whole early-2000s debacle that frankly gave Java a bad name and enabled the rise of php and Rails and the like.
Struts is Struts and never really appealed to me. Wicket looks more lightweight but still seems config-heavy. I think that's the one thing, from a coding standpoint, that makes even contemporary Java still feel 15 years behind: configuration hell. It's just part of the whole Java mindset, that it's never really shaken (even in Android!), that a major part of my coding life should be spent configuring the framework. C# and .NET has moved away from that more and more and to me it's a much better environment for it. This is all subjective tho. YMMV.
So what do you use? What makes you happy in the Java world these days (I'd really like to hear).
It appears you haven't really done enterprise Java for a long time.
For a start, J2EE is history, anything using J2EE is a legacy project. JEE6 is the latest Java Enterprise Spec and it's fairly lightweight, you have to use almost zero xml configuration (everything is annotations) and you and you can turn a plain old java object into a bean with just one annotation (@Stateless) and you can even inject beans anywhere with just one annotation.
The same is true for the newer versions of Spring, pretty much no XML config required anymore.
I use JEE6 and Spring, these are as powerful as ever but with less and less actual implementation nightmares with every release. They have looked at the other frameworks and stolen all the best ideas in their latest form.
Play! for java is also a great framework although it doesn't have much adoption by anyone I care about.
Awesome, thanks for that -- and no, I haven't done enterprise Java in a while. If one could swap out Spring with Guice (annotation-driven as well), sounds like a framework I could live with. I do appreciate the move away from configuration files to annotations that a lot of Java frameworks seem to be embracing.
Fair enough. I was pleasantly surprised how much ASP MVC had cribbed from Rails, and it sounds like I'd likely be similarly enthused about new JEE developments. I have noticed the trend towards annotation-driven development and moving away from configuration in Java frameworks and heartily approve.
Rails -> Spring MVC (albeit we still don't have a mature ActiveRecord but I concur that the Java world prefers the Repository pattern a'la DataMapper/Merb)
The whole Rails ecosystems is pretty much:
1) Spring MVC
2) ORM (Hibernate/JPA2 or one of the newest tool is Spring-Data)
Java's JVM/bytecode infrastructure on the other hand has undergone a renaissance as a VM platform for a lot of very cool languages: Scala and Clojure being the two big examples there. But that's Really not the same thing as Java, obviously. And there's Android -- a completely different ecosystem, and somewhat truncated as a Java dialect, but still basically the Java language and able to employ most of the libs you're used to having: Guava, Guice and so on. No dynamic code gen, which stinks, but I know why they did it. So if you have Java under your belt and want to get into mobile stuff, that's a huge plus.
So, as a general-purpose language skill, Java is still really, really important to know and will have legs for a long time to come. ASP MVC is a great framework, and if you can't work in something like Django or Rails or the like, it comes in nice 3rd or 4th place in terms of making for general coder happiness. C# is a far more progressive and interesting language than Java, but that's a philosophical difference between the gatekeepers of the two languages: Java intentionally moves slow for the sake of stability and continuity, C#'s minders have apparently embraced a little of the 'move fast break things' attitude of some parts of the open source world. I prefer the latter, but understand the rationale of the former.
Me, I'm a Rails coder these days but also get to hop back into Java for Android dev and the rare foray into ASP work and they all have strengths and tradeoffs and they'll all be around a long time. The only thing I think I would avoid on principle, for my own sanity, is any enterprisey J2EE framework. That truly does feel like a massive leap backwards.