views:

41

answers:

1

I’m an experienced VB.NET developer, who wants to start with C#. I’m searching for a web based comparison between both languages syntax as quick reference.

I found myself arranging VB.NET syntax templates such as...

Public MustInherit Class BaseClass
    Public MustOverride Sub PublicMustOverrideSub(ByVal byValParam As Integer, ByRef byRefParam As String)

    Protected MustOverride Function ProtectedMustOverrideFunc() As Double

    Friend Sub FriendSubWithParamArray(ByVal ParamArray params() As Byte)
    End Sub

    Private Property PrivateProperty() As Integer
        Get
        End Get
        Set(ByVal value As Integer)
        End Set
    End Property

    Friend ReadOnly Property FriendReadOnlyProperty() As String
        Get
            Return String.Empty
        End Get
    End Property

    Public WriteOnly Property PublicWriteOnlyProperty() As Double
        Set(ByVal value As Double)
        End Set
    End Property
End Class

...starting Developer Fusion...

public abstract class BaseClass
{
    public abstract void PublicMustOverrideSub(int byValParam, ref string byRefParam);

    protected abstract double ProtectedMustOverrideFunc();

    internal void FriendSubWithParamArray(params byte[] @params)
    {
    }

    private int PrivateProperty {
        get { }
        set { }
    }

    internal string FriendReadOnlyProperty {
        get { return string.Empty; }
    }

    public double PublicWriteOnlyProperty {
        set { }
    }
}

...and consuming the results. But there must be a better way. Do you know one?

+2  A: 

A comprehensive comparison of C# and VB.net code bits can be found at http://www.harding.edu/fmccown/vbnet_csharp_comparison.html

A very good article about being a VB dev moving to C#: http://visualstudiomagazine.com/articles/2008/12/01/what-vb-devs-should-know-about-c.aspx

If you're into web casts, there's some very good DNRTV episodes on this subject. Definately check them out:

Patrick Karcher
Thanks for your answer, especially the first link. It is exactly what I am searching.
Dirk