Preview

Module 2-Varibale Naming Rules

Good Essays
Open Document
Open Document
738 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Module 2-Varibale Naming Rules
Researching the Variable Naming Rules
ITT Technical Institute
Introduction to Programming PT1420
3/30/2014

Programming languages has specific rules they must follow in order to make the code viable. No two programming languages are alike when it comes to following the rules for variable naming conventions. The previous statement is true for Java, Python and Visual Basic. Java’s rules and conventions for naming variables within its language must be abided by the programmer who wants to create a code effectively and efficiently. There are four (4) types of variables that are defined by the language: Instance, Class, Local and Parameters The variable names Java uses are case-sensitive. They may also be “…an unlimited-length sequence of Unicode letters and digits, beginning with a letter, the dollar sign "$", or the underscore character (_)” also the use of “subsequent characters may be letters, digits, dollar signs, or the underscore character” (Oracle ). It is advised, when using Java, to use naming variables that are full words and to avoid the use of short cryptic word abbreviations or mnemonics. However, the naming variable may not be used if it is a keyword or reserved word. If the name you choose consists of only one word, spell that word in all lowercase letters. If it consists of more than one word, capitalize the first letter of each subsequent word. Java’s programming language uses the ‘Declare’ convention in order for the naming variable to be used within the code.
When using Python, the naming rules are very similar to Visual Basic and Java. As such is it must begin with a letter (a-z, A-B) or with the underscore (_) character. The use other characters such as letters, numbers and the underscore character is permitted but “whitespace” is not permitted and may cause errors to occur when executing the code. According to Python, “CapitalizedWords (or CapWords, or CamelCase -- so named because of the bumpy look of its letters)



References: Microsoft Corporation. (n.d.). Visual Basic Naming Rules. Retrieved March 30, 2014, from Microsoft Developer Network: http://msdn.microsoft.com/en-us/library/ee440536%28v=office.12%29.aspx Oracle . (n.d.). The Java Tutorials: Vaiables. Retrieved March 30, 2014, from Oracle: http://docs.oracle.com/javase/tutorial/java/nutsandbolts/variables.html Python Software Foundation. (n.d.). PEP 8: Style Guide for Python Code. Retrieved March 30, 2014, from Python: http://legacy.python.org/dev/peps/pep-0008/#prescriptive-naming-conventions

You May Also Find These Documents Helpful