Visual Basic .NET Handling of Reserved Words
Visual Basic .NET allows you to use reserved words in code. If you
use a reserved word, such as Enum, as a variable, the IDE will place square brackets around the word. You can then use the reserved word in a non-reserved way as long as every occurrence has the brackets around the reserved word.
Using reserved words in this way probably isn't a good idea because it may lead to confusing, unsightly code. It's also a safe bet that this quirk won't survive for long.
Unfortunately, there are times when you may not be able to avoid using keywords, especially when they define a type. The System.Reflection namespace defines the type Assembly. Assembly is both a type and a keyword. When you declare Assembly
, the code editor will add the brackets around the Assembly type declaration but may not always add the brackets,
when a reserved word is used as a variable