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

  • Satisfactory Essays

    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.…

    • 333 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    This shows that there must be atleast one letter present for being identified as an identifier. It can have any number of letters in an identifier but they should be in lower-case.…

    • 703 Words
    • 3 Pages
    Good Essays
  • Good Essays

    This is our first individual assignment for Programming unit this semester. This assignment was given in December 2013, and submission date is on 10th February 2014.…

    • 1859 Words
    • 8 Pages
    Good Essays
  • Good Essays

    Generally, you shouldn 't use any names that are the same as the functions, statements, and…

    • 878 Words
    • 4 Pages
    Good Essays
  • Satisfactory Essays

    initial and last name. For example, Jessie Robinson's assignment for Section 1 would be named…

    • 309 Words
    • 3 Pages
    Satisfactory Essays
  • Good Essays

    Unit 16 Ao1

    • 529 Words
    • 3 Pages

    Programs need to store data at some time during the execution of processes. Data is held in variables which are names containers for each piece of data. Each variable must be given a name so it can be referred to again and again throughout the program. It should be something that is recognisable because for example variable 1 would be soon forgotten in a substantial piece of code. Variable names cannot be the same as code words such as print or run.…

    • 529 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    Captilzation Rules Coles

    • 435 Words
    • 2 Pages

    Rule 1: Capitalize the first word of a sentence, personal titles, and names of people.…

    • 435 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    mat540 quiz 1 review

    • 668 Words
    • 6 Pages

    ( A variable is a symbol used to represent an item that can take on any value,)…

    • 668 Words
    • 6 Pages
    Satisfactory Essays
  • Good Essays

    Unit 3 research

    • 383 Words
    • 2 Pages

    I think the convention that makes the most sense to me is the one limiting the amount of characters to a maximum of 30. If more than 30 characters where allowed name would become very long and confusing greatly increasing the chance of programming errors when creating the database.…

    • 383 Words
    • 2 Pages
    Good Essays
  • Good Essays

    Capitalize any name you could find on a map (Appalachian Mountains, Salt Lake City, Atlantic Ocean, Lake Erie, etc.) or that is widely recognized as a distinct place or region. Do not capitalize general directions or general locations.…

    • 1101 Words
    • 5 Pages
    Good Essays
  • Satisfactory Essays

    Anagram.Java

    • 448 Words
    • 2 Pages

    // the program treats upper and lower case letters as equivalent and ignore punctuation marks.…

    • 448 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    The convention that made the most sense to me is the views convention because by trying to use less abbreviations and acronyms is helps everyone to understand what you are saying. When you are using imaginative and common sense names then everyone even those who do not know much about will be able to recognize the names. The views convention was short and it made sure there not only was the abbreviations common but also that the prefix could be distinguished from the other conventions.…

    • 334 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Input will consist of a series of lines, each line containing one string. Each string will consist of up to 30 lower case letters, not necessarily distinct.…

    • 525 Words
    • 3 Pages
    Good Essays
  • Powerful Essays

    • You begin with the author’s surname – comma – and initials followed by a full stop.…

    • 1795 Words
    • 8 Pages
    Powerful Essays
  • Better Essays

    Human Factors Hmwk 2

    • 1098 Words
    • 5 Pages

    It's harder to distinguish all caps versus lower case. Using all caps violates the repetition principle of small multiples since there is a lack of difference with cap letters (no shape coding)…

    • 1098 Words
    • 5 Pages
    Better Essays