views:

293

answers:

5

Possible Duplicate:
Tips for moving from C# to Java?

As a fairly experienced .NET developer (since 1.0), I've seen quite a few interesting jobs in the local area which are primarily focused on Java EE, ESB, WebSphere, JSP etc. Now, I'm quite familiar with most .NET "techs", but Java is a mystery. I did a bit of J2SE programming at University (2003 ish), but nothing much since.

Has anyone made the same transition (or the opposite one) and could share some info, caveats, anything really! How comparable are the .NET and Java skillsets, and how easily can one make the transition?

+5  A: 

I've faced the same problem going the other way: Java EE to .NET.

I don't have too much trouble with mapping language constructs between the two languages. It's not difficult to figure out relational database access in one language or the other. Loops are loops, ifs are ifs, kids. No worries there.

I've read Jon Skeets "C# In Depth", so I've gotten an appreciation for some of the nice things that have been added to C# that go beyond Java: LINQ, closures, delegates, etc.

My problems had more to do with the other details.

Visual Studio is a mystery to me. I'm used to IntelliJ. ReSharper helps. But like any other IDE, until you become familiar with it you're going to be stumbling around, trying to map something that you know how to do well on another system to the new one. Visual Studio Express doesn't appear to be the same thing.

I'm also ignorant of organizing, packaging, and deploying applications. I'm in the dark on .NET modules, deployment to IIS instead of a Java EE app server like WebLogic, etc.

Using JUnit and TestNG in my Java projects is second nature. I don't have the same level of comfort with NUnit.

I simply don't have it on the tips of my fingers. It's like a person in a foreign country with a guide book to the language: "How do I say that?" I'm simply not fluent in .NET.

I could really use a good project and a month long pairing with an experienced guide to get me over the hump. But that's not my role on projects, so I'm stuck.

I'm more comfortable taking that same path with Python. I have PyCharm from JetBrains, so the IDE is a non-issue. Python modules are as plentiful and easy to use as 3rd party open source stuff that I'm used to. I've got a great book "Core Python" that's walking me through. And the more I use the language, the more I like it. I have the same packaging and deployment issues, but I'm more confident that I'll solve them on my own with Python than with .NET.

duffymo
Just a note: The Full Visual Studio has very good unit testing built in. You just rightclick a method, click "Create Test" and it creates the test for you in a seperate project. If the method was private, protected or internal it even creates an accessor object for it which allows the unit test to access all methods as if they were public (which is sometimes very handy and saves you the trouble of writing subclasses to test protected methods). I used NUnit after starting with those unit tests and NUnit just feels clumsy in comparision.
dbemerlin
Even with a wizard, you've still got to put the meat in the methods. And if your wizard just gives you "happy path" tests, I'd say it's doing you a disservice. Sometimes people that fall in love with wizards should take a step back.
duffymo
+2  A: 

As long as you stay away from complex classloader interactions, the language and standard library should feel home, what can be intimidating for somebody that comes from Microsoft shops is the overwhelming amount of libraries and middleware options, while the language is simple, the ecosystem is deep, very deep, and there is no real standard choice.

I would concentrate on the 'standard' techs in the J2EE tutorial for most enterprise shops, but if you ever get technical lead on a project, be ready to spend a lot of time researching the optimal set of tools for your style.

Josselin Pujo
+2  A: 

In my opinion the difference between Java and .NET (C#) is not that big, from a language perspective. I myself frequently use both although I'm using more Java than C#.

The problem is more the platform below and the class libraries that have a different structure and provide sometimes different concepts for the same thing. The main thing in my feeling is here that .NET is more driven by bundled/vendor libraries directly from Microsoft whereas on the Java Plattform most libraries and frameworks are coming from the platform-external sources.

So the best thing in that regard is looking at frequent problems you solved in .NET and try to solve them (partly) in Java to get a feel for the libraries and frameworks used there.

Another thing that is different between the platforms might be the concept of an Application Server in a Java EE environment, since I think .NET has no equivalent concept to host applications.

Sidenote regarding the IDE

Especially in respect of Refactoring support the Java Tooling you'll find in Eclipse, IntelliJ, NetBeans is much richer than in Visual Studio out of the box. Though ReSharper seems to add much of the missing functionality to Visual Studio.

Johannes Wachter
And IntelliJ is richer than both Eclipse and NetBeans. ReSharper closes that gap for Visual Studio.
duffymo
I've added that to my answer.
Johannes Wachter
A: 

I've recently made that transition. Like you, I've programmed using .NET since 1.0. It took me a few weeks to really get comfortable - but ultimately, coming from C#, it wasn't very difficult. The most confusing thing starting out was shifting from the .NET delegate-based event handling paradigm to Java's interface-based event handling paradigm. You'll be fine.

Regarding IDE - I still prefer Visual Studio to Eclipse, but everyone will have their own opinion about that. Eclipse has a ton of features and is rediculously expandable, but I'm more concerned with the basic functionality I use every day. I never realized how much code I wrote using the TAB key until I switched from Visual Studio to Eclipse. I really miss the quick auto-complete. If there's a way to turn a similar feature on in Eclipse (instead of typing CTRL-SPACE -> ENTER) please let me know. :)

Good luck! :)

bporter
A: 

I would suggest you to start with a small project using an architecture similar to .NET one like JSP which is like ASP or JSF -which is similar to Java Server Faces. Then you don't need to bother that much about the concept you will get more into language diferences and IDE, deployment and these stuff. Then you can go for a proper J2EE application.

Ehsan