<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://msmvps.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>What a C# Coder Should Know Before They Write VB - Updated</title><link>http://msmvps.com/blogs/kathleen/archive/2008/07/25/what-a-c-coder-should-know-before-they-write-vb-updated.aspx</link><description>I’ve repurposed this list and thus am making it a new post, linked from the previous. I realize this is long for a blog post, and that it changes too much, so I will be moving it to a page, once I rebuild my site (a great embarrassment). Initially I wanted</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP2 (Build: 40407.4157)</generator><item><title>re: What a C# Coder Should Know Before They Write VB - Updated</title><link>http://msmvps.com/blogs/kathleen/archive/2008/07/25/what-a-c-coder-should-know-before-they-write-vb-updated.aspx#1736235</link><pubDate>Thu, 29 Oct 2009 23:30:49 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1736235</guid><dc:creator>Visual C# Kicks</dc:creator><description>&lt;p&gt;I went from VB to C# and I personally miss modules. They could technically make for some poor code design, but so can a lot of other things&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1736235" width="1" height="1"&gt;</description></item><item><title>What a C# Coder Should Know Before They Write VB - Updated - Kathleen Dollard</title><link>http://msmvps.com/blogs/kathleen/archive/2008/07/25/what-a-c-coder-should-know-before-they-write-vb-updated.aspx#1734631</link><pubDate>Fri, 23 Oct 2009 20:56:59 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1734631</guid><dc:creator>DotNetShoutout</dc:creator><description>&lt;p&gt;Thank you for submitting this cool story - Trackback from DotNetShoutout&lt;/p&gt;
&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1734631" width="1" height="1"&gt;</description></item><item><title>re: What a C# Coder Should Know Before They Write VB - Updated</title><link>http://msmvps.com/blogs/kathleen/archive/2008/07/25/what-a-c-coder-should-know-before-they-write-vb-updated.aspx#1734623</link><pubDate>Fri, 23 Oct 2009 19:59:47 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1734623</guid><dc:creator>Eber Irigoyen</dc:creator><description>&lt;p&gt;&amp;quot;VB infers the type more quietly:&amp;quot;&lt;/p&gt;
&lt;p&gt;Dim list2 = New List(Of String)(New String() {&amp;quot;Fred&amp;quot;, &amp;quot;George&amp;quot;, &amp;quot;Bill&amp;quot;, &amp;quot;Percy&amp;quot;, &amp;quot;Ron&amp;quot;})&lt;/p&gt;
&lt;p&gt;how was that more &amp;quot;quietly&amp;quot; than this?&lt;/p&gt;
&lt;p&gt;var list2 = new List&amp;lt;string&amp;gt;() { &amp;quot;Bill&amp;quot;, &amp;quot;Percy&amp;quot;, &amp;quot;Fred&amp;quot;,&amp;quot;George&amp;quot;, &amp;quot;Ron&amp;quot; };&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1734623" width="1" height="1"&gt;</description></item><item><title>Have a background in C#, and starting to write some Visual Basic? (Lisa Feigenbaum) : EasyCoded</title><link>http://msmvps.com/blogs/kathleen/archive/2008/07/25/what-a-c-coder-should-know-before-they-write-vb-updated.aspx#1647788</link><pubDate>Mon, 15 Sep 2008 01:11:04 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1647788</guid><dc:creator>Have a background in C#, and starting to write some Visual Basic? (Lisa Feigenbaum) : EasyCoded</dc:creator><description>&lt;p&gt;Pingback from &amp;nbsp;Have a background in C#, and starting to write some Visual Basic? (Lisa Feigenbaum) : EasyCoded&lt;/p&gt;
&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1647788" width="1" height="1"&gt;</description></item><item><title>a-foton &amp;raquo; Have a background in C#, and starting to write some Visual Basic? (Lisa Feigenbaum)</title><link>http://msmvps.com/blogs/kathleen/archive/2008/07/25/what-a-c-coder-should-know-before-they-write-vb-updated.aspx#1647786</link><pubDate>Mon, 15 Sep 2008 01:06:57 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1647786</guid><dc:creator>a-foton » Have a background in C#, and starting to write some Visual Basic? (Lisa Feigenbaum)</dc:creator><description>&lt;p&gt;Pingback from &amp;nbsp;a-foton &amp;raquo; Have a background in C#, and starting to write some Visual Basic? (Lisa Feigenbaum)&lt;/p&gt;
&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1647786" width="1" height="1"&gt;</description></item><item><title>Have a background in C#, and starting to write some Visual Basic? (Lisa Feigenbaum)</title><link>http://msmvps.com/blogs/kathleen/archive/2008/07/25/what-a-c-coder-should-know-before-they-write-vb-updated.aspx#1647785</link><pubDate>Mon, 15 Sep 2008 01:02:06 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1647785</guid><dc:creator>The Visual Basic Team</dc:creator><description>&lt;p&gt;Maybe you just started a job at a company whose development is in VB. Maybe you&amp;#39;re working with XML,&lt;/p&gt;
&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1647785" width="1" height="1"&gt;</description></item><item><title>Have a background in C#, and starting to write some Visual Basic? (Lisa Feigenbaum)</title><link>http://msmvps.com/blogs/kathleen/archive/2008/07/25/what-a-c-coder-should-know-before-they-write-vb-updated.aspx#1647784</link><pubDate>Mon, 15 Sep 2008 01:00:33 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1647784</guid><dc:creator>The Visual Basic Team</dc:creator><description>&lt;p&gt;Maybe you just started a job at a company whose development is in VB. Maybe you&amp;#39;re working with XML,&lt;/p&gt;
&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1647784" width="1" height="1"&gt;</description></item><item><title>re: What a C# Coder Should Know Before They Write VB - Updated</title><link>http://msmvps.com/blogs/kathleen/archive/2008/07/25/what-a-c-coder-should-know-before-they-write-vb-updated.aspx#1647408</link><pubDate>Wed, 10 Sep 2008 22:58:38 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1647408</guid><dc:creator>Kathleen</dc:creator><description>&lt;p&gt;I just realized I never answered this...&lt;/p&gt;
&lt;p&gt;Actually the With construct creates a temporary variable and uses that within the With block. The dereferencing occurs only once at the start of the block. &lt;/p&gt;
&lt;p&gt;Kathleen&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1647408" width="1" height="1"&gt;</description></item><item><title>re: What a C# Coder Should Know Before They Write VB - Updated</title><link>http://msmvps.com/blogs/kathleen/archive/2008/07/25/what-a-c-coder-should-know-before-they-write-vb-updated.aspx#1644510</link><pubDate>Wed, 13 Aug 2008 11:00:24 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1644510</guid><dc:creator>int19h</dc:creator><description>&lt;p&gt;&amp;gt; Thanks for the comments. Everytime you dereference (. notation) you also take a small hit. &lt;/p&gt;
&lt;p&gt;You do, but the dereference occurs when using the unary dot operator inside &amp;quot;With&amp;quot; in VB as well.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1644510" width="1" height="1"&gt;</description></item><item><title>re: What a C# Coder Should Know Before They Write VB - Updated</title><link>http://msmvps.com/blogs/kathleen/archive/2008/07/25/what-a-c-coder-should-know-before-they-write-vb-updated.aspx#1643560</link><pubDate>Wed, 06 Aug 2008 14:58:54 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1643560</guid><dc:creator>Kathleen</dc:creator><description>&lt;p&gt;David,&lt;/p&gt;
&lt;p&gt;Thanks for the comments. Everytime you dereference (. notation) you also take a small hit. So, when you have a long dereference list &lt;/p&gt;
&lt;p&gt;WhosOnFirst.NoHesOnSecond.WhatsOnThird.Fourth&lt;/p&gt;
&lt;p&gt;And that is repeated several times, the derferencing hit is more than the variable initizlization. At least that was documented early on the VB help. I haven&amp;#39;t benchmarked where the change happens. &lt;/p&gt;
&lt;p&gt;With would rarely be used in the kind of code you displayed, although I think I should have been more clear because my implication that it is always faster could lead someone to use it excessively. &lt;/p&gt;
&lt;p&gt;Kathleen&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1643560" width="1" height="1"&gt;</description></item><item><title>re: What a C# Coder Should Know Before They Write VB - Updated</title><link>http://msmvps.com/blogs/kathleen/archive/2008/07/25/what-a-c-coder-should-know-before-they-write-vb-updated.aspx#1643481</link><pubDate>Tue, 05 Aug 2008 20:30:04 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1643481</guid><dc:creator>David Nelson</dc:creator><description>&lt;p&gt;@pablo,&lt;/p&gt;
&lt;p&gt;Yes it does, but many C# coders will be used to using enter for that same purpose, and will be frustrated by the fact that in VB pressing enter to accept Intellisense will also insert a newline.&lt;/p&gt;
&lt;p&gt;@Kathleen,&lt;/p&gt;
&lt;p&gt;&amp;quot;Get to know the With keyword...it will also speeds up your application somewhat.&amp;quot;&lt;/p&gt;
&lt;p&gt;I am not aware of any way that the With keyword can speed up an application. It is only a syntax shortcut. Take the following two functionally equivalent fragments:&lt;/p&gt;
&lt;p&gt;Dim rand As New Random()&lt;/p&gt;
&lt;p&gt;With rand&lt;/p&gt;
&lt;p&gt;Console.WriteLine(.Next(1, 6))&lt;/p&gt;
&lt;p&gt;Console.WriteLine(.NextDouble())&lt;/p&gt;
&lt;p&gt;Console.WriteLine(.Next(0, 100))&lt;/p&gt;
&lt;p&gt;End With&lt;/p&gt;
&lt;p&gt;Dim rand As New Random()&lt;/p&gt;
&lt;p&gt;Console.WriteLine(rand.Next(1, 6))&lt;/p&gt;
&lt;p&gt;Console.WriteLine(rand.NextDouble())&lt;/p&gt;
&lt;p&gt;Console.WriteLine(rand.Next(0, 100))&lt;/p&gt;
&lt;p&gt;If you look at the IL generated by a release build of these two fragments, the only difference is that the With version generates an extra local variable to store the result of the target expression (even if that expression is already a local variable). This translates to an extra reference slot on the stack and four extra IL instructions (one to initialize the extra variable, one to push it back onto the stack, and two to null it out at the end of the With block). A similar test with value types shows that the IL in that case is exactly equivalent.&lt;/p&gt;
&lt;p&gt;So it looks to me like With is less efficient in the case of reference types and no more efficient in the case of value types. What am I missing?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1643481" width="1" height="1"&gt;</description></item><item><title>re: What a C# Coder Should Know Before They Write VB - Updated</title><link>http://msmvps.com/blogs/kathleen/archive/2008/07/25/what-a-c-coder-should-know-before-they-write-vb-updated.aspx#1642816</link><pubDate>Thu, 31 Jul 2008 13:24:48 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1642816</guid><dc:creator>pablo</dc:creator><description>&lt;p&gt;3) ... (By the Ctl-Enter thing, I mean that you can&amp;#39;t just hit Enter to accept Intellisense. You must hit Ctl-Enter, or space or some other punctuation).&lt;/p&gt;
&lt;p&gt;Doesn&amp;#39;t the TAB key accept Intellisense with one key press and no side effects?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1642816" width="1" height="1"&gt;</description></item><item><title>re: What a C# Coder Should Know Before They Write VB - Updated</title><link>http://msmvps.com/blogs/kathleen/archive/2008/07/25/what-a-c-coder-should-know-before-they-write-vb-updated.aspx#1642441</link><pubDate>Mon, 28 Jul 2008 16:37:09 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1642441</guid><dc:creator>Michael Gillson</dc:creator><description>&lt;p&gt; &amp;nbsp;I changed jobs for only 10 months and was required to write in VB.NET &amp;nbsp;I was able to survive but I did not enjoy it. &amp;nbsp;I am glad to be back in C#.&lt;/p&gt;
&lt;p&gt; &amp;nbsp;Two things that I think that are very good in VB.NET are #29 - With and #47 - Named Arguments.&lt;/p&gt;
&lt;p&gt; &amp;nbsp;#1 - VB is a great language raised my blood pressure immediately. &amp;nbsp;My history is Delphi 1-7 and then C#. &amp;nbsp;I cannot remember how many times I wrote ActiveX controls in Delphi so the VB coders could perform some task. &amp;nbsp;There were so many language things in VB6 and early that made VB an inconsistent language to program in. With VB.NET, VB is much better. &amp;nbsp;Just as C# is better than Delphi. &amp;nbsp;So I still have a hard time with the VB is a great language. &amp;nbsp;For instance, #42 says if iterators are needed, write them in C#.&lt;/p&gt;
&lt;p&gt; &amp;nbsp;#21 - VB uses parens for both method calls and indexes. Sorry.&lt;/p&gt;
&lt;p&gt; &amp;nbsp;#32 - continuation character – the underscore followed by a space.&lt;/p&gt;
&lt;p&gt; &amp;nbsp;#37 - Namespaces. &amp;nbsp;VB.NET general hides them from you making things &amp;quot;easier&amp;quot; but then when programs grow in size, the developer has a new challenge.&lt;/p&gt;
&lt;p&gt; &amp;nbsp;#41 - Missing Surround With. &amp;nbsp;I use C# snippets from the IntelliSense and I use Surround With.&lt;/p&gt;
&lt;p&gt; &amp;nbsp;#60 - On Error, glad you recommend against using it.&lt;/p&gt;
&lt;p&gt; &amp;nbsp;The list above are just some of the things that frustrate me in VB.NET. &amp;nbsp;I know this was not the purpose of your post but I would find it interesting to see what makes VB.NET coders frustrated in writing in C# and what makes C# coders frustrated in writing in VB.NET.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1642441" width="1" height="1"&gt;</description></item><item><title>re: What a C# Coder Should Know Before They Write VB - Updated</title><link>http://msmvps.com/blogs/kathleen/archive/2008/07/25/what-a-c-coder-should-know-before-they-write-vb-updated.aspx#1642429</link><pubDate>Mon, 28 Jul 2008 14:04:13 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1642429</guid><dc:creator>Kathleen</dc:creator><description>&lt;p&gt;Chris,&lt;/p&gt;
&lt;p&gt;Working on making that happen...&lt;/p&gt;
&lt;p&gt;Kathleen&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1642429" width="1" height="1"&gt;</description></item><item><title>re: What a C# Coder Should Know Before They Write VB - Updated</title><link>http://msmvps.com/blogs/kathleen/archive/2008/07/25/what-a-c-coder-should-know-before-they-write-vb-updated.aspx#1642428</link><pubDate>Mon, 28 Jul 2008 14:04:12 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1642428</guid><dc:creator>Kathleen</dc:creator><description>&lt;p&gt;Chris,&lt;/p&gt;
&lt;p&gt;Working on making that happen...&lt;/p&gt;
&lt;p&gt;Kathleen&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1642428" width="1" height="1"&gt;</description></item><item><title>re: What a C# Coder Should Know Before They Write VB - Updated</title><link>http://msmvps.com/blogs/kathleen/archive/2008/07/25/what-a-c-coder-should-know-before-they-write-vb-updated.aspx#1642423</link><pubDate>Mon, 28 Jul 2008 12:39:05 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1642423</guid><dc:creator>Chris Pietschmann</dc:creator><description>&lt;p&gt;Now, where&amp;#39;s the &amp;quot;What a VB Coder Should Know Before They Write C#&amp;quot; article?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1642423" width="1" height="1"&gt;</description></item><item><title>Help For C# Coders Going To VB.NET</title><link>http://msmvps.com/blogs/kathleen/archive/2008/07/25/what-a-c-coder-should-know-before-they-write-vb-updated.aspx#1642144</link><pubDate>Fri, 25 Jul 2008 17:42:22 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1642144</guid><dc:creator>The Rafael Van Dyke Blog</dc:creator><description>&lt;p&gt;Help For C# Coders Going To VB.NET&lt;/p&gt;
&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1642144" width="1" height="1"&gt;</description></item><item><title>Help For C# Coders Going To VB.NET</title><link>http://msmvps.com/blogs/kathleen/archive/2008/07/25/what-a-c-coder-should-know-before-they-write-vb-updated.aspx#1642143</link><pubDate>Fri, 25 Jul 2008 17:41:51 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1642143</guid><dc:creator>The Rafael Van Dyke Blog</dc:creator><description>&lt;p&gt;Help For C# Coders Going To VB.NET&lt;/p&gt;
&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1642143" width="1" height="1"&gt;</description></item></channel></rss>