Fog Creek Software
Discussion Board

Welcome! and rules

Joel on Software

Transitioning from VB to C#

I've got a solid two years of Visual Basic .NET & I just got a new position at a shop where the major development language is C#.  They gave me the position based on a strong knowledge of the .NET model & a good SQL Server background.  My first projects will be in VB so I'm looking at this as an opportunity to learn C#.

Just wanted to ask the smart people of the forum for advice (books, helpful hints, etc.) for making that leap in as short of a time as possible.  I'd like to be impressive.  From an initial review it seems like its relatively simple.  And mostly just knowing new syntax (void not sub, and using the curly braces). 

Am I deluding myself?  Thanks for the input.

Thursday, September 16, 2004

There is not a great deal of difference between the two, although don't forget the semi-colons too ;-)

VB.NET has a few capabilities that C# does not, and vice versa, so it'd be a good idea to be familiar with these, so you know what'll be missing and what'll be new. Having said that, its trivial to write a class in VB, then inherit it in C#, so it isn't really a problem (although some shops don't like this mixing of languages).

The main difference is the syntax, as you will already know. The best way to deal with that is to look at some example code written in C#. This will show you how the various language constructs work.

Or, just skim through a "C# for dummies" book and it'll give you the basics you need.

As an alternative, if you've ever done any client-side Javascript you won't be able to tell the difference between that and C# (in most cases). That's how I "learnt" it when it first came out. I was looking at it and realised I already "knew" the language, from doing so much Javascript (and C/C++/MFC a long time ago, yuk).

Friday, September 17, 2004

Use SharpDevelop, open some .vb files, and click on the 'Tools', 'Convert Buffer VB.NET to C#' menu item.

Its not about 'static' vs. 'shared' and semicolons and all that other crap. Its about the libraries.

.NET Neophyte
Friday, September 17, 2004

You could cut and paste some VB code into this converter and see how it looks in C#...

Sunday, September 19, 2004

Jan Kool
Wednesday, September 22, 2004

*  Recent Topics

*  Fog Creek Home