On C# and VB

I’ve noticed that there is a bit of (understandable) confusion about what we publish in C# and what we publish in VB, and I thought I’d write a brief not to try to sort it out.

I believe Tim and I are in agreement that:

  • Our blog samples will be in whichever language we happen to be most comfortable in, with some variety now and again (and I further suspect that will usually be C#)
  • The videos that we create will (nearly) always provide source code in both C# and VB, but the video itself will be in our language of comfort
  • At the moment, I’m writing all the tutorials, and I’m doing so in both C# and VB.NET — that each tutorial is published in a C# version and a VB version, in both HTML and in a pdf format, and of course the code is available in both.

TutorialLanguages

The goal is to provide access to all of this information at a very high level of comfort for both VB and C# programmers. 

My personal opinion is that it is important to be able to read programs in either language; they are incredibly similar, and translating from one to the other is, for the most part, mechanical. 

Instant Maven

One wonderful resource, both for saving time and for learning whichever language you are less comfortable in, is InstantC# or InstantVB

 InstantVBCompleted2

It is not uncommon for me to put in an entire solution developed as an example for a tutorial or video and have it converted in seconds, requiring no hand changes whatsoever

(Full disclosure: as noted  previously, I’ve been receiving free evaluation copies). 

Notice in the illustration above that I’ve circled the link to "Compare converted to original code. This little feature can be very useful when you want to learn a bit of VB/C# syntax,

InstantVBComparison

though the truth is that the limitations in this window mean that you can only go so far. If I were truly interested in spending time looking at the two versions I’d put the files (or the entire folders) through Exam Diff Pro – my favorite utility for comparing files or directories,

ExamDiff

What is interesting here, though, is not the quality of the comparison utility but rather that such a comparison is possible and straight forward.  You can practically map from the C# to the VB, word by word, line by line.

VBCSharp

You are very much entitled to love one and hate the other, but I would suggest it is the familiarity that breeds the contempt; the true hatred one can only feel for members of one’s own Klan.

In any case, next stop: Iron Ruby.

Hope your holiday was splendid.

Share

About Jesse Liberty

Jesse Liberty is an independent consultant and programmer with three decades of experience writing and delivering software projects. He is the author of 2 dozen books and multiple Pluralsight courses, and has been a Senior Technical Evangelist for Microsoft, a Distinguished Software Engineer for AT&T, a VP for Information Services for Citibank and a Software Architect for PBS. He is a Xamarin Certified Mobile Developer and a Xamarin MVP, Microsoft MVP and Telerik MVP.
This entry was posted in z Silverlight Archives. Bookmark the permalink.

2 Responses to On C# and VB

  1. Buy Apples says:

    F*ckin?tremendous issues here. I am very satisfied to peer your article. Thanks so much and i’m having a look forward to touch you. Will you kindly drop me a e-mail?

Leave a Reply

Your email address will not be published.