Moving from Java to C#
After about 10 years working primarily in Java, I’m a few weeks in to my first commercial C# project. The transition was much smoother than I’d expected and after some head-scratching around the syntax additions in C# 3, I feel productive.
I’m surprised how little time I have needed to spend learning the .NET framework libraries and exploring the .NET open source community. As a business app, most of the code I am writing models the domain and interacts with other parts of the domain; it is all written by the team. With the exception of things like the collections classes, most of the framework/library interaction is on the fringes of the system. That said I’ve done my fair share of Googling things like ‘How do I parse XML in .NET’, but the community is large and so it’s easy to find solutions to problems. A harder part is learning C# idioms, the Manning book C# in Depth was great for this (see later) as were chats with my teammates and pair.
Along the way I’ve picked up a few useful resources:
Resources
- A Comparison of Microsoft’s C# Programming Language to Sun Microsystems’ Java Programming Language
- C# in Depth
- The C# Programming Language for Java Developers
This is great when you are still thinking in Java. It maps Java features on to C# and points out areas where features exist in Java but not C# and vice versa.
Despite the name, this book is very approachable and has great coverage of the evolution of C# from v1 through to v3.
Quite dry but some useful advice from MSDN.
Other thoughts
- Get Resharper
- Remember there is an eco-system outside of Microsoft
If you are familiar with Java IDEs like Eclipse or IntelliJ and regularly re-factor then you will need Resharper. The out of the box support for refactoring is minimal even in VS2008.
Many companies having selected .NET will automatically favour Microsoft solutions for everything. Even though the open-source community doesn’t appear as vibrant as for Java, it does exist. Check out alt.net too.
[...] Moving from Java to C# A senior ThoughtWorker talks about his first C# project 10 years after he first tasted the java bean. [...]
Daily Dose #4 | Floyd's Thoughts...
20 Aug 08 at 5:43 pm