{"id":3509,"date":"2012-03-08T21:27:43","date_gmt":"2012-03-08T21:27:43","guid":{"rendered":"https:\/\/test.simple-talk.com\/uncategorized\/vb-myth-case-insensitivity-is-awesome\/"},"modified":"2016-07-28T10:50:44","modified_gmt":"2016-07-28T10:50:44","slug":"vb-myth-case-insensitivity-is-awesome","status":"publish","type":"post","link":"https:\/\/www.red-gate.com\/simple-talk\/blogs\/vb-myth-case-insensitivity-is-awesome\/","title":{"rendered":"VB Myth &#8211; Case Insensitivity is Awesome!"},"content":{"rendered":"<p>I was reading <a href=\"http:\/\/www.simple-talk.com\/author\/andy-brown\/\">Andy Brown<\/a>&#8216;s article <a href=\"http:\/\/www.simple-talk.com\/dotnet\/.net-framework\/10-reasons-why-visual-basic-is-better-than-c\/\">10 Reasons Why Visual Basic is Better than C#<\/a> and the first claim is that VB is superior because of case insensitivity.&#160; I think the reasons he outlines are basically as follows:<\/p>\n<ul>\n<li>Your fingers get tired finding the shift key (e.g. typing PascalCase and camelCase members)<\/li>\n<li>You are much more likely to make mistakes while typing names<\/li>\n<li>When you accidentally leave caps lock on, it really matters<\/li>\n<\/ul>\n<p>These three arguments culminate in the conclusion:<\/p>\n<p><strong>&#8220;It doesn&#8217;t matter if you disagree with everything else in this article: case-sensitivity alone is sufficient reason to ditch C#!&#8221;<\/strong><\/p>\n<p>Righto.&#160; I&#8217;ve been using Visual Basic since version 5.0, I wrote a book about ASP.NET in Visual Basic, so I want everyone to know I&#8217;m definitely not a VB.NET hater.&#160; I had to converted to C# because it was the language of preference at the places I&#8217;ve worked, so I&#8217;m used to both languages.&#160; I love me some case sensitivity.&#160; So first, let&#8217;s debunk the claims.<\/p>\n<p>First, your fingers do not get tired of finding the shift key unless you are writing code in notepad and compiling everything on the command line.&#160; Visual Studio pretty much takes away the need to use the shift key at all. For the most part, any programmer worth a damn doesn&#8217;t have to type more than about 3-5 characters of any variable or method name before IntelliSense kicks in to help.&#160; VB or C#, if you are not using the tab key for autocomplete then you are typing too much anyway, regardless of whether the shift key is involved or not.&#160; Also, you&#8217;ve got to be a pretty hard-core candy ass if you&#8217;re complaining at the end of the day that your little fingers are hurting from hitting the shift key.<\/p>\n<p>Second, I cannot logically refute the fact that if there are more stringent rules about case sensitivity it will lead to more mistakes.&#160; As such, know that you will be more prone to mistakes in C#.&#160; However, lets talk about the magnitude of the problem.&#160; If you are using IntelliSense then you have auto-correction built in so you probably won&#8217;t have much of a problem in the first place.&#160; If you manage to bypass IntelliSense and type something wrong you normally are immediately presented with a red-squiggly to let you know something is amiss.&#160; Normally, a person would look at the problem, figure out what the heck went wrong, and then avoid that problem again in the future.&#160; Granted, I have met people who seem to lack this capability, but their problem is deeper than a decision between VB.NET and C#.&#160; So let&#8217;s make sure that we&#8217;re all on the same page about this problem.&#160; If you have two teams of developers, one that uses VB.NET and one that uses C#, do not expect to see the VB.NET team drinking beer at the end of the project in festive revelry while the C# team is crying over what the hell to do because their code is riddled with case-sensitivity problems that nobody can resolve.<\/p>\n<p>Lastly, if you leave your caps lock key on, turn it off.&#160; Really, what kind of ass-hat would write an entire VB.NET application ENTIRELY IN CAPS?&#160; <\/p>\n<p>I happen to be a fan of case sensitivity because it encourages precision and uniformity.&#160; The last thing I need is a code base that looks like it was ransacked by LeEt HacKors wHo Can uSe wHateVer cASe tHey wanT.&#160; I mean really, if you saw someone write this:<\/p>\n<p>PuBLIc Sub MyMethod   <br \/>.    <br \/>End Sub    <\/p>\n<p>And upon asking them why BL was upper case, they responded &#8220;Oh, I accidentally hit the shift key there.&#160; Fortunately for me VB.NET is a case insensitive language so I saved a couple of keystrokes by leaving it in there.&#8221;&#160; Or if you saw:<\/p>\n<p>PUBLIC SUB ANOTHERMETHOD   <br \/>.    <br \/>END SUB    <\/p>\n<p>And the response to why it was uppercased was &#8220;Yeah, I accidentally had caps locks on, fortunately for me VB.NET doesn&#8217;t care.&#160; Really dodged a bullet there, glad I wasn&#8217;t using C#.&#8221;&#160; <\/p>\n<p>Would you not think that a bit ridiculous?&#160; If you want to convince C# developers that C# sucks, go for it.&#160; But the case insensitivity argument is crap.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was reading Andy Brown&#8216;s article 10 Reasons Why Visual Basic is Better than C# and the first claim is that VB is superior because of case insensitivity.&#160; I think the reasons he outlines are basically as follows: Your fingers get tired finding the shift key (e.g. typing PascalCase and camelCase members) You are much&#8230;&hellip;<\/p>\n","protected":false},"author":46738,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[2],"tags":[],"coauthors":[],"class_list":["post-3509","post","type-post","status-publish","format-standard","hentry","category-blogs"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/3509","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/users\/46738"}],"replies":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/comments?post=3509"}],"version-history":[{"count":2,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/3509\/revisions"}],"predecessor-version":[{"id":42136,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/3509\/revisions\/42136"}],"wp:attachment":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/media?parent=3509"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/categories?post=3509"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/tags?post=3509"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/coauthors?post=3509"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}