简体   繁体   中英

Searching systematic, comprehensive and complete comparison between the syntax of VB.NET and C#

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?

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:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM