Unit 2 Research Assignment 1
Sierra Baltins
Thursday
For Visual Basic a variable’s name must have a letter as the first character, you cannot use spaces, periods, or other special characters such as !@#. The name cannot exceed 255 characters. The variable should not have a similar name as the functions, statements, and methods, and the name cannot be repeated within the scope. This language is not case sensitive.
Python has a maximum line length of 79 characters. Use one leading underscore for non-public methods and instance variables. A programmer should use two leading underscores to avoid name clashes with subclasses. Lower case words with underscores should be used for naming functions. Capitalized words with underscores
should be used to name constants. No leading underscores should be used for public attributes. If a public attribute clashes with a reserved keyword, the programmer can put a single trailing underscore to the attribute name.
Unlike Visual Basic and Python, Java variable names are case sensitive. Java’s does not have a limited line length. The variable name must always start with a letter. Subsequent characters can either be letters, numbers or special characters. Some auto-generated names begin with a “$”, but a programmer should avoid using this character and the underscore as the first character. If using one word, all characters must be lower case. If more than one word is used, CamelCase should be used. A constant value should be all capitalized and an underscore should be used as a space.
In comparison, all languages should use CamelCase or underscores to separate the words in a variable name. The names should be easily recognized from other keywords. Spaces are also not allowed. In contrast, each language has different line length, some are case-sensitive, and some languages do not allow special characters.
Citations
(1995). Variables. http://docs.oracle.com/javase/tutorial/java/nutsandbolts/variables.html.
Baltins, S. (2015). Unit 2 Research Assignment 1.
Coghlan, N., Rossum, G., Warsaw, B. (2013). PEP 0008 – Style Guide for Python Code. https://www.python.org/dev/peps/pep-0008/#method-names-and-instance-variables.
Visual Basic Naming Rules. https://msdn.microsoft.com/en-us/library/office/gg264773.aspx.