Skip to content

Instantly share code, notes, and snippets.

@LoganBarnett
Created August 1, 2013 17:27
Show Gist options
  • Save LoganBarnett/6133464 to your computer and use it in GitHub Desktop.
Save LoganBarnett/6133464 to your computer and use it in GitHub Desktop.
An example of silliness if C#'s scoping rules.
if(true) {
var bar = "bazz";
DoSomethingWithBar(bar);
}
var bar = "qux"; // oh noes! You already declared bar even though you can't get to it and it's out of scope.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment