From the course: Visual Basic Essential Training
Unlock this course with a free trial
Join today to access over 24,500 courses taught by industry experts.
Naming your variables - Visual Basic Tutorial
From the course: Visual Basic Essential Training
Naming your variables
- [Instructor] We are going to talk about naming rules and naming conventions. Naming rules are what are enforced by the compiler. If you break the rules, you can't compile your code. Naming conventions are suggested ways of naming your variables and other parts of your .NET code. The naming conventions I'm talking about are the Microsoft internal guidelines, and they are common in most .NET libraries and used by lots of .NET developers. We'll start with the rules. I mentioned some of these in the slides. First rule, it must begin with an alphabetic character or an underscore. So, here's an example of a variable that starts with an underscore, and here's one, it starts with an alpha character. They can contain alphabetic characters, decimal digits, and underscores. So, here's an example of one that contains a number in the middle. Here's one that contains an underscore in the middle. Here's an example of a non-valid name because it starts with the number 5, that's not allowed. So if I…
Contents
-
-
-
-
-
-
-
-
(Locked)
Work with variables and constants8m 17s
-
(Locked)
Use the code explorer project3m 26s
-
(Locked)
Declare a variable5m 35s
-
(Locked)
Variables and .NET types3m 36s
-
(Locked)
Naming your variables2m 19s
-
(Locked)
Understand the variable scope: What code can access the variable4m 19s
-
How data conversion works7m 49s
-
(Locked)
Convert numeric values5m 35s
-
(Locked)
Create custom constants1m 29s
-
(Locked)
Work with built-in constants3m 36s
-
(Locked)
Work with enum values3m 45s
-
(Locked)
Create a custom enum1m 35s
-
(Locked)
-
-
-
-
-
-
-
-
-
-
-
-