Preview

Unit 2 Research Variable Naming Rules

Satisfactory Essays
Open Document
Open Document
368 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Unit 2 Research Variable Naming Rules
Michael Lewis
PT 1420 Intro to Programming
Unit 2 Research (Variable Naming Rules)

Python: Must begin with a letter (a - z, A - B) or underscore (_); other characters can be letters, numbers or _; Case Sensitive; Can be any (reasonable) length; There are some reserved words which you cannot use as a variable name because Python uses them for other things.

Visual Basic: 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. To use an intrinsic language function, statement, or method that conflicts with an assigned name, you must explicitly identify it. Precede the intrinsic function, statement, or method name with the name of the associated type library. For example, if you have a variable called Left, you can only invoke the Left function using VBA.Left.
You can't repeat names within the same level of scope. For example, you can't declare two variables named age within the same procedure. However, you can declare a private variable named age and a procedure-level variable named age within the same module.

Java: All variable names must begin with a letter of the alphabet, an underscore, or (_), or a dollar sign ($).
The convention is to always use a letter of the alphabet. The dollar sign and the underscore are discouraged.
After the first initial letter, variable names may also contain letters and the digits 0 to 9. No spaces or special characters are allowed.
The name can be of any length, but don't get carried away. Remember that you will have to type this name.
Uppercase characters are distinct from lowercase characters. Using ALL uppercase letters are primarily used to identify constant variables. Remember that variable names are

You May Also Find These Documents Helpful