Visual Basic Naming Rules Essay

726 Words Jul 23rd, 2013 3 Pages
Visual Basic Naming Rules Use the following rules when you name procedures, constants, variables, and arguments in a Visual Basic module: •You must use a letter as the first character. •You can't use a space, period (.), exclamation mark (!), or the characters @, &, $, # in the name. •Name can't exceed 255 characters in length. •Generally, you shouldn't use any names that are the same as the functions, statements, and methods in Visual Basic. You end up shadowing the same keywords in the language. http://msdn.microsoft.com/en-us/library/office/ee440536(v=office.12).aspx Python Variable Naming Rules: 1. Must begin with a letter (a - z, A - B) or underscore (_). 2. Other characters can be letters, numbers or _ only. …show more content…
In many cases implementing the value as a method is a better choice: 6. Names representing methods must be verbs and written in mixed case starting with lower case. This is identical to variable names, but methods in Java are already distinguishable from variables by their specific form. 7. Abbreviations and acronyms should not be uppercase when used as name. Using all uppercase for the base name will give conflicts with the naming conventions given above. A variable of this type whould have to be named dVD, hTML etc. which obviously is not very readable. Another problem is illustrated in the examples above; When the name is connected to another, the readability is seriously reduced; The word following the acronym does not stand out as it should. 8. Private class variables should have underscore suffix. Apart from its name and its type, the scope of a variable is its most important feature. Indicating class scope by using underscore makes it easy to distinguish class variables from local scratch variables. This is important because class variables are considered to have higher significance than method variables, and should be treated with special care by the programmer. An issue is whether the underscore should be added as a prefix or as a suffix. Both practices are commonly used, but the latter is recommended because it seems to best preserve the readability of the name. It should be noted that scope identification in

Related Documents