views:

168

answers:

5

see also Good VB.Net 2008/3.5 Reference Book? and Converting C# knowledge to VB.NET any potential problems?

Or other good resource for an experienced (5 years C#, before that 10 years C/C++) C# programmer to learn VB.NET.

I am being forced to program in and understand a lot of VB.NET code (I was not told that most of code was in VB.NET when I took this job)

Therefore I have to learn VB.NET, however VB.NET books etc seem to assume you don’t know have to program and that you don’t have a computer science degree.


Edit

I am getting problem like the VB programmers not know what I am talking about when I ask about lambda expressions and higher level functions etc. Also I have just hit a case when I used a query expression in VB.NET when I would have just used the extension method directly in C# as VB.NET is so limited in it’s support for lambda expressions.

So I think there is a different mindset to how a VB.NET person goes about designing classes etc, I need to get into that mind set.

+7  A: 

VB.NET isn't a new way of thinking, it's just writing it out with some different statements.

Throw some code through a C#-to-VB.NET converter to see the syntax differences, that's how I switched from VB.NET to C# in some two weeks.

As long as you got the basics (like If .. Else .. End If instead of if { } else { }, switches and loops), plus some generic stuff like List<string> becomes List(Of String). You'll pick it up very quick.

Check also the MSDN documentation about Language Equivalents, for some handy tables.

edit I don't think you are facing a language problem here, but more an awareness problem, which also can rise between C# developers. If a dev doesn't keep up with new language / framework constructs you get this type of problems.

Most of the new fancy stuff like anonymous types, LINQ, lambda expressions and extension methods work perfectly fine in VB.NET. You'll have to raise awareness at your co-workers though.

Furthermore: lambda's aren't as crippled as you're stating. You can either use lambda's, delegates, or a complete LINQ statement to achieve exactly what you were looking for in C#.

Jan Jongboom
+1  A: 

C# & VB.NET Conversion Pocket Reference is a great little (144 page) reference book that details the main syntax differences between vb & c#.

http://www.amazon.co.uk/C-VB-NET-Conversion-Pocket-Reference/dp/0596003196/ref=sr_1_fkmr3_1?ie=UTF8&amp;qid=1263898241&amp;sr=8-1-fkmr3

Combined with a good online code converter, such as http://www.carlosag.net/Tools/CodeTranslator/ you should be able to pick it up quite quickly.

hearn
It looks like the book was published in 22 April 2002, therefore am I right to assume it does not cover .NET 3.5?
Ian Ringrose
Yep. Its quite an old book, so no new 3.5 goodness unfortunately.
hearn
+1  A: 

The VB language does not require a different mindset than C#. Some people coming from a VB6 background will have a different mindset, but THEY should adapt to the .Net and Object-Oriented Design mindset.

I am a VB.Net coder and know about lambda expressions and higher-order functions. This has nothing to do with the language and everything to do with the people you work with. You're right that VB9 lambdas are a bit limited, but this will change in the next (2010) version.

The only thing you should maybe adapt to is the VB-specific functions (for example the VB string functions) if they are used in the code you work with, but even then, in Vb.net it's better to use .Net specific functions (for Strings and other) which produces nicer object-oriented code.

Meta-Knight
+2  A: 

There were some useful articles in Visual Studio magazine back in Jan 2008.

You might also be interested in the similar question "Converting C# knowledge to VB.NET any potential problems?"

MarkJ
A: 

In terms of writing classes and class design rather than LINQ-specifics, you could do worse than to find a copy of Visual Basic.NET Class Design Handbook and C# Class Design Handbook which were designed as a pair by Wrox back in 2002. They're great for generic design differences. For the 3.5 differences, you could do worse that to look at the MSDN Code Gallery. The Visual Basic LINQ Video Series Samples starts by looking at the new language features of 3.5 that allow linq to work. That should cover lambda expressions etc.

Hmobius