Devlico.Us
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @devlicious

Jeff Perrin - Sexier Than You Are



Jeff in Java Land

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.



Comments

Thorbjørn said:

If you want to pass a function around in Java you create a suitable interface, let the class conform to it, and pass that around.

# January 2, 2007 1:21 AM

Ernst Kuschke (C# MVP) said:

Hi,

So it seems that C# as a language is superior to Java. I'm sure that you'd agree that the biggest reason for this is not language itself, but the .NET Framework being superior to the Java class libraries, no?! :-)

The IDE, unfortunately, is what you need to utilise all of that, and I have to admit that VS has far to go to catch up.

# January 3, 2007 2:58 AM

About Jeff Perrin

Jeff is not an internationally (or even locally) known expert in anything related to software development. He holds no certifications worth speaking about, and didn't graduate from University. The value of anything written on his blog should be deemed suspect at the minimum, and blatantly false and misleading in the worst case. Don't let his innate sex appeal fool you... Jeff does not know anything about which he speaks. Check out Devlicio.us!

Our Sponsors

Red-Gate!

Proudly Partnered With