<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>C# Frequently Asked Questions : C#/VB.NET Equivalents</title><link>http://blogs.msdn.com/csharpfaq/archive/tags/C_23002F00_VB.NET+Equivalents/default.aspx</link><description>Tags: C#/VB.NET Equivalents</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>How to keep a local variable in scope across a try and catch block?</title><link>http://blogs.msdn.com/csharpfaq/archive/2004/08/12/213883.aspx</link><pubDate>Fri, 13 Aug 2004 01:33:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:213883</guid><dc:creator>CSharpFAQ</dc:creator><slash:comments>17</slash:comments><comments>http://blogs.msdn.com/csharpfaq/comments/213883.aspx</comments><wfw:commentRss>http://blogs.msdn.com/csharpfaq/commentrss.aspx?PostID=213883</wfw:commentRss><description>&lt;p&gt;&lt;font face="Arial"&gt;The following code won't work, because &lt;font face="Courier New"&gt;conn&lt;/font&gt; goes out of scope before you enter the &lt;font face="Courier New"&gt;catch&lt;/font&gt; block.&lt;/font&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR: blue"&gt;try&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Connection conn = &lt;span style="COLOR: blue"&gt;new&lt;/span&gt; Connection();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;conn.Open();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR: blue"&gt;catch&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR: blue"&gt;if&lt;/span&gt; (conn != &lt;span style="COLOR: blue"&gt;null&lt;/span&gt;) conn.Close();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;o:p&gt;&lt;font face="Arial"&gt;The fix is simple - just declare &lt;font face="Courier New"&gt;conn&lt;/font&gt; before entering the &lt;font face="Courier New"&gt;try&lt;/font&gt; block &lt;/font&gt;&lt;/o:p&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;font face="Arial"&gt;&lt;/font&gt;&lt;/o:p&gt;&amp;nbsp;&lt;/p&gt;&lt;o:p&gt;&lt;font face="Arial"&gt;&lt;/font&gt;&lt;/o:p&gt;&lt;font face="Arial"&gt;&lt;font size="2"&gt; &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Connection conn = &lt;span style="COLOR: blue"&gt;null&lt;/span&gt;; &lt;span style="COLOR: green"&gt;// Note the assignment to null to avoid error CS0165 - Use of possibly unassigned local variable 'conn'.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR: blue"&gt;try&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;conn = &lt;span style="COLOR: blue"&gt;new&lt;/span&gt; Connection();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;conn.Open();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR: blue"&gt;catch&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR: blue"&gt;if&lt;/span&gt; (conn != &lt;span style="COLOR: blue"&gt;null&lt;/span&gt;) conn.Close();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;font face="Times New Roman" size="3"&gt;&amp;nbsp;&lt;/font&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;o:p&gt;&lt;font face="Times New Roman" size="3"&gt; &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;font face="Arial"&gt;Of course, for this particular example, you could wrap the &lt;font face="Courier New"&gt;Connection&lt;/font&gt; class in one that implements &lt;font face="Courier New"&gt;IDisposable&lt;/font&gt; (if it does not already), so that you could then use a &lt;font face="Courier New"&gt;using&lt;/font&gt; statement instead of extending the scope of the local.&lt;/font&gt;&lt;/o:p&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;font face="Arial"&gt;&lt;/font&gt;&lt;/o:p&gt;&amp;nbsp;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;font face="Arial"&gt;&lt;/font&gt;&lt;/o:p&gt;&amp;nbsp;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/o:p&gt;[author: SantoshZ]&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=213883" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/csharpfaq/archive/tags/C_2300_+Language+and+Compiler/default.aspx">C# Language and Compiler</category><category domain="http://blogs.msdn.com/csharpfaq/archive/tags/C_23002F00_VB.NET+Equivalents/default.aspx">C#/VB.NET Equivalents</category></item><item><title>Where can I get a full comparison between C# and VB.NET?</title><link>http://blogs.msdn.com/csharpfaq/archive/2004/03/12/88477.aspx</link><pubDate>Fri, 12 Mar 2004 10:31:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:88477</guid><dc:creator>CSharpFAQ</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.msdn.com/csharpfaq/comments/88477.aspx</comments><wfw:commentRss>http://blogs.msdn.com/csharpfaq/commentrss.aspx?PostID=88477</wfw:commentRss><description>&lt;p&gt;
  Microsoft provides a very full 
  &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsintro7/html/vxgrfLanguageEquivalents.asp"&gt;language
  equivalents&lt;/a&gt; page which compares not only C# and VB.NET, but also other languages targeted at the .NET framework.
  It looks at the equivalent concepts, keywords, types, operators etc. A very valuable resource when you're trying to
  read or write code in a language which isn't your preferred one.
&lt;/p&gt;
&lt;p&gt;
  [Author: Jon Skeet]
&lt;/p&gt;

&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=88477" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/csharpfaq/archive/tags/C_23002F00_VB.NET+Equivalents/default.aspx">C#/VB.NET Equivalents</category></item><item><title>Is there an equivalent of &lt;code&gt;MyClass&lt;/code&gt;?</title><link>http://blogs.msdn.com/csharpfaq/archive/2004/03/12/88476.aspx</link><pubDate>Fri, 12 Mar 2004 10:30:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:88476</guid><dc:creator>CSharpFAQ</dc:creator><slash:comments>8</slash:comments><comments>http://blogs.msdn.com/csharpfaq/comments/88476.aspx</comments><wfw:commentRss>http://blogs.msdn.com/csharpfaq/commentrss.aspx?PostID=88476</wfw:commentRss><description>&lt;p&gt;
  No, C# doesn't have an equivalent of VB.NET's &lt;code&gt;MyClass&lt;/code&gt; keyword. If you want to guarantee
  not to call an overridden version of a method, you need to make it non-virtual in the first place.
&lt;/p&gt;
&lt;p&gt;
  [Author: Jon Skeet]
&lt;/p&gt;
&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=88476" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/csharpfaq/archive/tags/C_23002F00_VB.NET+Equivalents/default.aspx">C#/VB.NET Equivalents</category></item><item><title>What do I use instead of &lt;code&gt;addressof&lt;/code&gt;?</title><link>http://blogs.msdn.com/csharpfaq/archive/2004/03/12/88475.aspx</link><pubDate>Fri, 12 Mar 2004 10:29:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:88475</guid><dc:creator>CSharpFAQ</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/csharpfaq/comments/88475.aspx</comments><wfw:commentRss>http://blogs.msdn.com/csharpfaq/commentrss.aspx?PostID=88475</wfw:commentRss><description>&lt;p&gt;
  To create delegate instances in C#, you just specify the delegate type, the method, and (if
  you want to create a delegate targetting a different instance or type from the current one) the target.
  For instance, each of these creates a &lt;code&gt;ThreadStart&lt;/code&gt; delegate:
&lt;/p&gt;
&lt;pre&gt;
ThreadStart x1 = &lt;font color="Blue"&gt;new&lt;/font&gt; ThreadStart(SomeInstanceMethod);
ThreadStart x2 = &lt;font color="Blue"&gt;new&lt;/font&gt; ThreadStart(AnotherType.SomeStaticMethod);
ThreadStart x3 = &lt;font color="Blue"&gt;new&lt;/font&gt; ThreadStart(someVariable.SomeInstanceMethod);
&lt;/pre&gt;
&lt;p&gt;
  [Author: Jon Skeet]
&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=88475" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/csharpfaq/archive/tags/C_23002F00_VB.NET+Equivalents/default.aspx">C#/VB.NET Equivalents</category></item><item><title>How do I get the rightmost part of a string, as with the VB &lt;code&gt;Right&lt;/code&gt; function?</title><link>http://blogs.msdn.com/csharpfaq/archive/2004/03/12/88472.aspx</link><pubDate>Fri, 12 Mar 2004 10:28:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:88472</guid><dc:creator>CSharpFAQ</dc:creator><slash:comments>10</slash:comments><comments>http://blogs.msdn.com/csharpfaq/comments/88472.aspx</comments><wfw:commentRss>http://blogs.msdn.com/csharpfaq/commentrss.aspx?PostID=88472</wfw:commentRss><description>&lt;p&gt;
  Use &lt;code&gt;String.Substring&lt;/code&gt;. Assuming that &lt;code&gt;x&lt;/code&gt; is a string of length at least
  &lt;code&gt;n&lt;/code&gt;, to get the last &lt;code&gt;n&lt;/code&gt; characters, you would use &lt;code&gt;x.Substring(x.Length-n)&lt;/code&gt;.
&lt;/p&gt;
&lt;p&gt;
  Note that the above assumes that the string is at least &lt;code&gt;n&lt;/code&gt; characters long. For a more robust version, 
  you might use something like: &lt;code&gt;x.Length &lt; n ? x.Substring(x.Length-n) : x&lt;/code&gt;.
&lt;/p&gt;
&lt;p&gt;
  [Author: Jon Skeet]
&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=88472" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/csharpfaq/archive/tags/C_23002F00_VB.NET+Equivalents/default.aspx">C#/VB.NET Equivalents</category></item><item><title>What are the equivalents of &lt;code&gt;Me&lt;/code&gt; and &lt;code&gt;MyBase&lt;/code&gt;?</title><link>http://blogs.msdn.com/csharpfaq/archive/2004/03/12/88471.aspx</link><pubDate>Fri, 12 Mar 2004 10:27:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:88471</guid><dc:creator>CSharpFAQ</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/csharpfaq/comments/88471.aspx</comments><wfw:commentRss>http://blogs.msdn.com/csharpfaq/commentrss.aspx?PostID=88471</wfw:commentRss><description>&lt;p&gt;
  &lt;code&gt;Me&lt;/code&gt; in C# is &lt;code&gt;this&lt;/code&gt;, and &lt;code&gt;MyBase&lt;/code&gt; in C# is &lt;code&gt;base&lt;/code&gt;. To access
  normal members, just use &lt;code&gt;this.memberName&lt;/code&gt; or &lt;code&gt;base.memberName&lt;/code&gt;. For information
  about chaining constructors together, see my 
  &lt;a href="http://www.pobox.com/~skeet/csharp/constructors.html"&gt;article on constructors&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
  [Author: Jon Skeet]
&lt;/p&gt;


&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=88471" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/csharpfaq/archive/tags/C_23002F00_VB.NET+Equivalents/default.aspx">C#/VB.NET Equivalents</category></item><item><title>What's the equivalent of &lt;code&gt;Nothing&lt;/code&gt;?</title><link>http://blogs.msdn.com/csharpfaq/archive/2004/03/12/88470.aspx</link><pubDate>Fri, 12 Mar 2004 10:26:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:88470</guid><dc:creator>CSharpFAQ</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/csharpfaq/comments/88470.aspx</comments><wfw:commentRss>http://blogs.msdn.com/csharpfaq/commentrss.aspx?PostID=88470</wfw:commentRss><description>&lt;p&gt;
  For reference types, the equivalent of VB's &lt;code&gt;Nothing&lt;/code&gt; is C#'s &lt;code&gt;null&lt;/code&gt;.
  For value types, it's the default value - &lt;code&gt;0&lt;/code&gt;, &lt;code&gt;false&lt;/code&gt;, etc.
&lt;/p&gt;
&lt;p&gt;
  [Author: Jon Skeet]
&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=88470" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/csharpfaq/archive/tags/C_23002F00_VB.NET+Equivalents/default.aspx">C#/VB.NET Equivalents</category></item><item><title>Why doesn't C# have VB.NET's 'with' operator?</title><link>http://blogs.msdn.com/csharpfaq/archive/2004/03/11/87817.aspx</link><pubDate>Thu, 11 Mar 2004 10:02:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:87817</guid><dc:creator>CSharpFAQ</dc:creator><slash:comments>22</slash:comments><comments>http://blogs.msdn.com/csharpfaq/comments/87817.aspx</comments><wfw:commentRss>http://blogs.msdn.com/csharpfaq/commentrss.aspx?PostID=87817</wfw:commentRss><description>&lt;P&gt;Many people, including the C# language designers, believe that 'with' often harms readability, and is more of a curse than a blessing. It is clearer to declare a local variable with a meaningful name, and use that variable to perform multiple operations on a single object, than it is to have a block with a sort of implicit context. &lt;/P&gt;
&lt;P&gt;For more information, see the &lt;A href="http://msdn.microsoft.com/vcsharp/team/language/ask/withstatement/default.aspx"&gt;Ask a C# Language Designer&lt;/A&gt; page. &lt;/P&gt;
&lt;P&gt;[Author: Jon Skeet] &lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=87817" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/csharpfaq/archive/tags/C_2300_+Language+and+Compiler/default.aspx">C# Language and Compiler</category><category domain="http://blogs.msdn.com/csharpfaq/archive/tags/C_23002F00_VB.NET+Equivalents/default.aspx">C#/VB.NET Equivalents</category></item><item><title>What are the advantages of C# over VB.NET and vice versa?</title><link>http://blogs.msdn.com/csharpfaq/archive/2004/03/11/87816.aspx</link><pubDate>Thu, 11 Mar 2004 09:59:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:87816</guid><dc:creator>CSharpFAQ</dc:creator><slash:comments>36</slash:comments><comments>http://blogs.msdn.com/csharpfaq/comments/87816.aspx</comments><wfw:commentRss>http://blogs.msdn.com/csharpfaq/commentrss.aspx?PostID=87816</wfw:commentRss><description>&lt;p&gt;
  The choice between C# and VB.NET is largely one of subjective 
  preference. Some people like C#'s terse syntax, others like VB.NET's 
  natural language, case-insensitive approach. Both have access to the same 
  framework libraries. Both will perform largely equivalently (with a few 
  small differences which are unlikely to affect most people, assuming 
  VB.NET is used with &lt;code&gt;Option Strict&lt;/code&gt; on). Learning the .NET framework itself is
  a much bigger issue than learning either of the languages, and it's perfectly possible
  to become fluent in both - so don't worry &lt;i&gt;too&lt;/i&gt; much about which to plump for. There are, 
  however, a few actual differences which may affect your decision:
&lt;/p&gt;
&lt;h5&gt;VB.NET Advantages&lt;/h5&gt;
&lt;ul&gt;
  &lt;li&gt;Support for optional parameters - very handy for some COM interoperability&lt;/li&gt;
  &lt;li&gt;
    Support for late binding with &lt;code&gt;Option Strict&lt;/code&gt; off - type safety at compile time
    goes out of the window, but legacy libraries which don't have strongly typed interfaces
    become easier to use.
  &lt;/li&gt;
  &lt;li&gt;
    Support for named indexers (aka properties with parameters).
  &lt;/li&gt;
  &lt;li&gt;
    Various legacy VB functions (provided in the &lt;code&gt;Microsoft.VisualBasic&lt;/code&gt; namespace, and can be
    used by other languages with a reference to the &lt;code&gt;Microsoft.VisualBasic.dll&lt;/code&gt;). Many of
    these can be harmful to performance if used unwisely, however, and many people believe they should
    be avoided for the most part.
  &lt;/li&gt;
  &lt;li&gt;
    The &lt;code&gt;with&lt;/code&gt; construct: it's a matter of debate as to whether this is an advantage or not,
    but it's certainly a difference.
  &lt;/li&gt;
  &lt;li&gt;
    Simpler (in expression - perhaps more complicated in understanding) event handling, where
    a method can declare that it handles an event, rather than the handler having to be set up in code.
  &lt;/li&gt;
  &lt;li&gt;
    The ability to implement interfaces with methods of different names. (Arguably this makes it harder
    to find the implementation of an interface, however.)
  &lt;/li&gt;
  &lt;li&gt;
     &lt;code&gt;Catch ... When ...&lt;/code&gt; clauses, which allow exceptions to be filtered based on runtime expressions
      rather than just by type.
  &lt;/li&gt;
  &lt;li&gt;
    The VB.NET part of Visual Studio .NET compiles your code in the background. While this is considered an
    advantage for small projects, people creating very large projects have found that the IDE slows down considerably
    as the project gets larger.
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h5&gt;C# Advantages&lt;/h5&gt;
&lt;ul&gt;
  &lt;li&gt;
    XML documentation generated from source code comments. (This is coming in VB.NET with
    Whidbey (the code name for the next version of Visual Studio and .NET), and there are tools which will do it with existing VB.NET code
    already.)
  &lt;/li&gt;
  &lt;li&gt;Operator overloading - again, coming to VB.NET in Whidbey.&lt;/li&gt;
  &lt;li&gt;
    Language support for unsigned types (you can use them from VB.NET, but they aren't in the language
    itself). Again, support for these is coming to VB.NET in Whidbey.
  &lt;/li&gt;
  &lt;li&gt;
    The &lt;code&gt;using&lt;/code&gt; statement, which makes unmanaged resource disposal simple.
  &lt;/li&gt;
  &lt;li&gt;
    Explicit interface implementation, where an interface which is already implemented in a base class
    can be reimplemented separately in a derived class. Arguably this makes the class harder to understand,
    in the same way that member hiding normally does.
  &lt;/li&gt;
  &lt;li&gt;
    Unsafe code. This allows pointer arithmetic etc, and can improve performance in some situations.
    However, it is not to be used lightly, as a lot of the normal safety of C# is lost (as the name implies).
    Note that unsafe code is still managed code, i.e. it is compiled to IL, JITted, and run within the CLR.
  &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
  Despite the fact that the above list appears to favour VB.NET (if you don't mind waiting for Whidbey),
  many people prefer C#'s terse syntax enough to make them use C# instead.
&lt;/p&gt;
&lt;p&gt;
  [Author: Jon Skeet]
&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=87816" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/csharpfaq/archive/tags/C_2300_+Language+and+Compiler/default.aspx">C# Language and Compiler</category><category domain="http://blogs.msdn.com/csharpfaq/archive/tags/C_23002F00_VB.NET+Equivalents/default.aspx">C#/VB.NET Equivalents</category></item></channel></rss>