Monday, December 03, 2007

Learning Java

Most developers live in one camp or the other. Few people who work inside the Microsoft ecosystem (Win32, .Net, ASP.Net) spend much time in Java, and vice versa. That's what makes religious wars about languages IDEs so lame; most programmers have never seriously worked with both.

That's why it's refreshing to see Erik Sink trying out Java. I spent last winter going from C# to Eclipse and can echo many of his points:

  • the Java string comparison (can't use ==) is a huge gotcha for C# programmers. It fails silently (no compiler warning or runtime exception). Which is fine considering that's the Java rule for strings (use equals()). CheckStyle or some other lint-like tool can catch this.
  • The key bindings take getting used to. F11, F6, F5, F8 in Eclipse, instead of F5, F10, F11, and F5 for Visual Studio for Debug, StepOver, StepInto, and Continue. I could re-map these, but I think it's better to simply get used to them (which gets harder as one gets older!).
  • The Java ecosystem is much more active and innovative. Spring, Hibernate, and other fascinating efforts occur here. Over in the .Net world, people generally sit around and wait for Microsoft to do something. Or they port good ideas from the Java world.