Jeremy over at CodeBetter.com just wrote a post about his experiences in Java Land, and since I've been working on a Java project for over a year and a half now (with at least another year to go), I thought I'd share my thoughts as well.
Before I get into this, I'll divulge some info about myself. I learned Java in school, but had never worked on a real Java project before this one. The majority of my previous projects had been in C#. The Java project I'm currently working on is large, with over 35 developers. We are practicing Domain-Driven Design and TDD, with Eclipse as our IDE.
- First off, as Jeremy states, the language difference is negligible. It took me a day or two to get back up to speed.
- Eclipse absolutely destroys Visual Studio as a pure code editor. Java as a language is quite verbose, but Eclipse makes this moot by literally typing 90% of my code for me. It creates classes, interfaces, methods and everything else I'd want, in addition to providing complex refactoring tools out of the box. Its CVS integration is seamless, out of the box. Its TDD integration is seamless (again, out of the box). I've patched together a similar feature set in VS with Resharper and AnkhSVN, but the fact is, the total feature set is still not up to par, and Eclipse is free.
- My personal opinion is that C# is a superior language. I posted why I think this on my personal blog. The biggest thing I miss when coding in Java is C#'s delegates; I feel like there are a bunch of icky parts in our Java architecture that would look so much sexier if I could just pass around a function.
- Java's class library is a bit of a mess. As Jeremy states, the date/time handling parts are especially ugly. This is probably because Java's been around longer, has to keep old API's around for backwards compatibility, and C# has had the benefit of learning from Java's mistakes.
- Checked exceptions are messy. They may be good when you're working with another developer's API, but when you're working within your own domain they're just noise. We have a massive domain in our project, but the points in the code where we actually care about checked exceptions are... I'll say non-existent. There are points where we look for a specific exception but they are few and far between, and could probably have been designed around in the first place.
- Java's Generics implementation is pure compiler fluff. There's no support at the runtime level like in C#, so even if you create a generic list of Products, you can still add an object that is not a product to that list. The only real reason to use them for lists is so you can get the Java equivalent of C#'s foreach construct to work.
All in all, it should be apparent that I really like where C# is going, especially in 3.0. I get frustrated with the verbosity of Java at times, but for the most part, the utter superiority of Eclipse more than makes up for it. Eclipse plus Java makes me more productive than VS plus Resharper plus AnkhSVN.
12-30-2006 5:18 PM