Is Visual Basic case sensitive?!

Ever since confessing I am being attracted to the dark side, I have hated the idea of having to give up the case sensitivity that I know and love from such languages as C#, Java, C++ and JavaScript.

But on Michael Kaplan's blog I found something that might puzzle even the most addicted VB fan. What does this code print when run?

Module Module1

    Sub Main()
        Call Pröcedure1()
    End Sub

    Sub Pròˆcedure1()
        Console.WriteLine("Schrödinger's cat is not dead.")
    End Sub

    Sub PRÖCEDURE1()
        Console.WriteLine("Schrödinger's cat is dead.")
    End Sub

End Module

Nope, it doesn't produce a compiler error as you might expect. Give your guess here as a comment and then head over to Michael's blog for the answer. To try it out yourself in Visual Studio copy-and-paste the code in Module1.vb in a freshly created Visual Basic console application project.

One thought on “Is Visual Basic case sensitive?!

Leave a Reply

Your email address will not be published. Required fields are marked *