How do I tune up my C# Skills, when I have spent the last decade coding in VB?

I personally would start by converting a VB.NET project into C#, having done VB.NET it wouldn't be difficult once you got started as they both use the same underlying CLR.

Doing it this way step by step, looking up how to convert each bit you don't understand, you'll soon end up teaching yourself C# based on you're knowledge of VB.NET and you'll see they're really not that much different!

I find them very similar now I know them both, they just have a habit of doing things 'slightly' differently.

Also, have a look at this wiki page for a summary comparison of VB.NET and C#, and check out the examples at the bottom to see some basic syntax comparisons that will give you a starting point for converting VB.NET into C#.


Since VB.NET and C# are both first-class object-oriented .NET languages that compile down to the nearly the same CIL code, I find it fairly easy to switch between the two. Most of the learning curve in .NET comes from learning the myriad APIs; syntax doesn't take terribly long to pick up.

I'd recommend a good book that focuses on the language of C# (that is, not a framework such as Winforms, Silverlight, or WPF). A book that I really liked was Illustrated C# 2008 by Daniel Solis. It's great at exposing the C# language from end to end. (NOTE: Although it says "Illustrated" in the title, it's not filled with lots of pretty pictures. "Illustrated" simply means that the author uses lots of helpful diagrams to explain concepts).

Also, I spent a good deal of time solving math problems at http://www.projecteuler.net in order to learn C#. It helps to have real problems to solve to learn a language and Project Euler offers problems that are small enough that you can still focus on learning different aspects of the language.


It's odd that you are having this difficulty if you can still remember anything about C. I have a similar background but I don't find C# hard to read at all.

Are you getting confused by LINQ or lambdas / anonymous methods? EDIT you say it's LINQ: here are some links for LINQ.

  • The LINQ syntax is different in VB from C# and there's not much help out there for the VB syntax. The MSDN 101 VB LINQ samples are good, and I also liked the coverage in the book Programming VB 2008.
  • Lambdas are a way of writing methods inline that might be the "inline syntax" you are referring to? In which case, just read up on them and try them out: you could try them out in C# or VB.Net.

There were some useful articles on differences between C# and VB.Net in Visual Studio magazine back in Jan 2008.

  • What VB developers should know about C#
  • And for completeness, What C# developers should know about VB

You might also be interested in the question "what's allowed in VB that is prohibited in C# (or vice versa)"

Full disclosure: the bottom part of this answer is copied almost unchanged from this question on converting C# knowledge to VB.Net

Tags:

C#

Vb.Net