Monday, June 15, 2009

C# VB.Net Keyword Comparison

I needed a quick cheat sheet that compares C# keywords with those that VB.Net uses so that I could perform a code-walkthrough on someone else’s code. Here is what I came up with:

C# VB.Net
this Me
base MyBase
static Shared
sealed NotInheritable (class definitions)
NotOverridable (class methods)
abstract MustInherit (class definitions)
MustOverride (class methods)
virtual Overridable
null Nothing
note: setting a variable to Nothing in VB.Net, actually sets it to its default value. On reference types this is equivalent to null in C#.
DBNull.Value NULL
typeof GetType
if x is {type} if TypeOf x is {type}
   

1 comment:

Remember, if you want me to respond to your comment, then you need to use a Google/OpenID account to leave the comment.