Unit 2 Research Assignment 1: Researching Variable Naming Rules

Submitted by: Submitted by

Views: 732

Words: 303

Pages: 2

Category: Other Topics

Date Submitted: 03/26/2014 02:11 PM

Report This Essay

Python:

Must begin with a letter (a - z, A - B) or underscore (_).

Other characters can be letters, numbers or _ only.

Variable names are Case Sensitive.

There are some reserved words which we can’t be used because Python uses them for other things.

Java:

Must begin with a letter of the alphabet, an underscore, or ( _ ), or a dollar sign ($). 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.

Uppercase characters are distinct from lowercase characters. Using ALL uppercase letters are primarily used to identify constant variables.

Variable names are case sensitive.

You cannot use a java keyword (reserved word) for a variable name.

Visual Basic:

The name must being with a letter of the alphabet.

The name must consist only of letters, digits, and the underscore character. (No punctuation marks are allowed.)

The name can be as long as 255 characters.

Variable names can’t be duplicated with the same scope.

Similarities and Differences

The things they all have in common are they are all case sensitive, no spaces or special characters are allowed, and there is no length for the names. Things that are different are some have reserved words that you must know that you can’t use. Java lets the name begin with an underscore ( _ ) or a dollar sign ($)even though they are discouraged.

References

“Python Naming Variables,” Programr, From http://www.programr.com/python-variable-naming-rules. Accessed April 20, 2013

“Naming Rules for Variables,” Beginning Java – Unit 2 Naming Rules, From http://mathbits.com/MathBits/Java/DataBasics/Namingrules.htm. Accessed April 20, 2013

“”Variables in Visual Basic,” Go 4 Expert, From http://www.go4expert.com/articles/variables-visual-basic-t3626/. Accessed April 20, 2013