On starting Java from a C# developer’s perspective

Copied this from an email I sent to a coworker but that it would be a good thing to post here.

K this should be a good bit on getting you started. I’m definitely not professing to be a java expert or anything but, I wouldn’t mind helping out if you had an issue or at least pointing you in the right direction if I don’t know.

Good Books on Java

Effective Java is Full of Win. Awesome thumb through book for those of us that don’t know all the rich history of java and want just the facts in a concise, quick and easy (and most of all “Effective”) way. (I’m looking at you Arrays, Lists,Vectors, ArrayLists, Collections). Latest Edition covers jdk 1.6 (1.7 is the latest at the time of this post but there aren’t a ton of differences between the two and come to think of it I believe the Java philosophy is all about not breaking changes with previous versions so no worries about the materials being out of date.)

Bruce Eckel’s thinking in java is pretty good too.

If nothing else take a look at it because it is freely available and awesome.
Differences between C# and Java
  • Java enums are awesome
  • Java generics are implemented differently
  • camelCaseIsRecommended
  • C# has a ton of features that java does not.
  • Java doesn’t have delegates natively (see Closure and Scala language for JVM alternatives)
  • In the simplest terms the JVM is similar to .NET platform. (I said similar not the same) You will find scripting language alts for the given languages. Example Iron Ruby & JRuby. So there are options out there for you if Java isn’t your cup of tea or you want to integrate some scripting stuff you’ve previously written.
 Stackoverflow.com related questions.
IDE Choices

Additionally if you are going the lightweight route then you probably want to know this http://www.zdnetasia.com/debug-java-applications-without-an-ide-39179162.htm
Automating Software Builds

In .Net land you have alot of this taken care of for you with msbuild and Visual Studio but, in java land it can be a bit more complicated. One of the more popular options is Ant and I’d say the next most used is Maven.

Maven requires a bit more investigation that Ant in terms of how it works but, is pretty powerful once you get the hang of it. It would probably be a good idea to look at both since it gets into the sort of emacs vs vim type of debate so with that you should get educated and decide for yourself. Comparison of Ant and Maven

At some point MVC Frameworks, Unit testing, Logging and other extra become a necessity.
What I’ve used (and or) read about…

  • Log4J for logging is pretty awesome.
  • Spring framework adds alot to the Java programmers toolkit to include, MVC, Aspect oriented Programming, Dependency Injection and crap loads more.
  • JUnit seems to be a popular Unit Testing Framework in the java world.