<?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>Comparing C# and VB.NET</title><link>http://blogs.msdn.com/theoy/archive/2005/06/20/430838.aspx</link><description>A reader wrote me just now: Hi, I just came across your blog and seeing that you're mentioning random thoughs on .NET, I was hoping you'd be able to answer this question: Is there any real difference to coding in VB or in C# when it comes to the .NET</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: Comparing C# and VB.NET</title><link>http://blogs.msdn.com/theoy/archive/2005/06/20/430838.aspx#430841</link><pubDate>Mon, 20 Jun 2005 22:14:30 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:430841</guid><dc:creator>Max</dc:creator><description>Thanks for the explanation. Personally, I prefer the C coding syntax over VB's, but as you pointed out, it's the developer's (or in this case the boss's) choice :)</description></item><item><title>re: Comparing C# and VB.NET</title><link>http://blogs.msdn.com/theoy/archive/2005/06/20/430838.aspx#430842</link><pubDate>Mon, 20 Jun 2005 22:19:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:430842</guid><dc:creator>theCoach</dc:creator><description>The answer I would be interested in would be is there IL that can be generated by C# code that cannot be generated from VB code (regardless of how much longer the syntax needs to be), and the reverse.&lt;br&gt;&lt;br&gt;Protections would be one. It is possible as well (but not advisable) to create a class in C# that has both:&lt;br&gt;private void DoIt() // and &lt;br&gt;private void doIT()&lt;br&gt;&lt;br&gt;which is not possible in VB.net, also not CLS.&lt;br&gt;Things like that. How about Interoping or Unsafe code?</description></item><item><title>re: Comparing C# and VB.NET</title><link>http://blogs.msdn.com/theoy/archive/2005/06/20/430838.aspx#431914</link><pubDate>Thu, 23 Jun 2005 18:22:30 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:431914</guid><dc:creator>TheoY</dc:creator><description>Regarding syntax, I'd have to admit that I'm more acclimated to C-family languages (C/C++/C#/Java).&lt;br&gt;&lt;br&gt;Regarding different IL operations - I'm not an expert at this, but a couple of things come to mind, but most of these require advanced knowledge of the CLR:&lt;br&gt;&lt;br&gt;(1) VB allows users to make a non-virtual call to a virtual method.  I've seldom wanted to do this, except for where I think the API was missing something.  For example, when an object overrides Object.GetHashCode(), there usually is no way for other code to access what the original Object.GetHashCode() *would* have returned (which is usually based off of a hash for some uniqueness of each object instance).  In VB.NET (and C++ for .NET) you can *non-virtually* call GetHashCode() and actually call into the implementation defined by the System.Object class.&lt;br&gt;&lt;br&gt;This breaks a lot of assumptions of programmers who are assuming that overriding a base virtual method will obscure the ability to directly invoke the base implementation.  I'd take a pretty confident guess too, that most VB.NET programmers either don't use this, or aren't aware when they are using it.&lt;br&gt;&lt;br&gt;(2) I think &amp;quot;yield&amp;quot; iterators, a C# 2.0 feature, employs a special construct of try/fault under the hood, if you're using &amp;quot;yield&amp;quot; in the scope of a try/finally block.&lt;br&gt;&lt;br&gt;(3) Like you said, C# supports unsafe code, and VB doesn't.  Unsafe code has a whole family of IL operations...&lt;br&gt;&lt;br&gt;(4) VB allows exception filters (similar to C++/SEH filters) so that you can run an expression while you're deciding to handle the exception.  This is useful if you'd like multiple exception blocks to execute the same catch logic, but it makes it harder to discern whether a catch block may or may not be evaluated.</description></item><item><title>Comparing C# and VB.NET</title><link>http://blogs.msdn.com/theoy/archive/2005/06/20/430838.aspx#6573604</link><pubDate>Wed, 28 Nov 2007 11:58:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6573604</guid><dc:creator>Comparing C# and VB.NET</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://feeds.maxblog.eu/item_757754.html"&gt;http://feeds.maxblog.eu/item_757754.html&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>Website Scripts &amp;raquo; D Melodic Minor Accidental : Comparing C# and VB.NET</title><link>http://blogs.msdn.com/theoy/archive/2005/06/20/430838.aspx#7179836</link><pubDate>Mon, 21 Jan 2008 08:11:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7179836</guid><dc:creator>Website Scripts » D Melodic Minor Accidental : Comparing C# and VB.NET</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://websitescripts.247blogging.info/d-melodic-minor-accidental-comparing-c-and-vbnet/"&gt;http://websitescripts.247blogging.info/d-melodic-minor-accidental-comparing-c-and-vbnet/&lt;/a&gt;&lt;/p&gt;
</description></item></channel></rss>