Pt1420 Researching Variable Naming Rules

In: Computers and Technology

Submitted By anniep
Words 653
Pages 3
Visual Basic has been labeled to be the most successful programming language in the history of programming. In 1991, Microsoft built Visual Basic on the older BASIC language – Beginner’s All purpose Symbolic Instruction Code (Mabutt). In the late 1980s, Alan Cooper, owner of Tripod, developed drag-and-drop interface, Ruby, which was also an influence to the idea of Visual Basic (History of Visual Basics). Just like any spoken language, rules must be followed in order to create effective communication between two people. For programming languages, it is necessary to follow all naming rules in order to build the program. Visual Basic’s variable name rules are as follows: Up to 255 characters, names must begin with a letter, no embedded spaces or special characters are to be used besides the underscore “__”, there cannot be a reserved word, uppercase and lowercase should be used with a purpose, and names cannot be repeated with the same level of scope (Visual Basic Naming Rules). If a developer does not follow these rules when using Visual Basic, there will be errors that may occur even before the program can be tested.
Python
Python is another common programming language, and was influenced by the design of ABC (Lukaszewski). In the 1996, Guido van Rossum created his very own version of ABCs, which we all know now as Python (Lukaszewski). Python is a basic syntax used for statement grouping, a list, strings, and numbers (Lukaszewski). Because it is another programming language, it also has its very own rules. Some rules are slightly different from Visual Basic, but all rules for Python are as follows: All names must begin with a letter or underscore, other characters can be letters, numbers or “__”, can be any (reasonable) length, it is case sensitive, and some reserved words cannot be used. Just like Visual Basic, not following these naming rules will result…...

Similar Documents

Pt1420 Unit 2: Research Assignment 1: Variable Naming Rules

...In Java, naming conventions for identifiers have been established and suggested by various Java communities such as Sun Microsystems, Netscape, AmbySoft etc. • The Classes names should be nouns in UpperCamelCase, with the first letter of every word capitalized. Use whole words — avoid acronyms and abbreviations (unless the abbreviation is much more widely used than the long form, such as URL or HTML). • Methods should be verbs in lowerCamelCase; that is, with the first letter lowercase and the first letters of subsequent words in uppercase. • Variable names should be short yet meaningful. The choice of a variable name should be mnemonic — that is, designed to indicate to the casual observer the intent of its use. One-character variable names should be avoided except for temporary "throwaway" variables. Common names for temporary variables are i, j, k, m, and n for integers; c, d, and e for characters. Local variables, instance variables, and class variables are also written in lowerCamelCase. Variable names should not start with underscore (_) or dollar sign ($) characters, even though both are allowed. Certain coding conventions state that underscores should be used to prefix all instance variables, for improved reading and program understanding. • Constants should be written in uppercase characters separated by underscores. Constant names may also contain digits if appropriate, but not as the first character. In Python its recommend to use UpperCamelCase for......

Words: 270 - Pages: 2

What Are Variable Naming Rules

...What are the variable naming rules of Visual Basic, Python, and Java? 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. 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. 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. Uppercase characters are distinct from lowercase characters.  Using ALL uppercase letters are primarily used to identify constant variables.  Remember that variable names are case-sensitive. You cannot use a...

Words: 290 - Pages: 2

Variable Naming Rules

...What are the variable naming rules of 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. What are the variable naming rules of 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 cannot use as a variable name because Python uses them for other things. These are :and, del, from, not, while, as, elif, global, or, with, assert, else, if, pass, yield, break, except, import, print, break, except, import, print, class, exec, in, raise, class, exec, in, raise, continue, finally, is, return, continue, finally, is, return, def, for, lambda and try . What are the variable naming rules of 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......

Words: 409 - Pages: 2

Unit 2 Research Assignment 1 Researching Variable Naming Rules

...1. What are the variable naming rules of Visual Basic, Python, and Java? 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. 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. 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. Uppercase characters are distinct from lowercase characters. Using ALL uppercase letters are primarily used to identify constant variables. Remember that variable names are case-sensitive. You cannot use a java keyword (reserved......

Words: 319 - Pages: 2

Visual Basic Naming Rules

...Visual Basic Naming Rules Use the following rules when you name procedures, constants, variables, and arguments in a Visual Basic module: •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. http://msdn.microsoft.com/en-us/library/office/ee440536(v=office.12).aspx Python Variable Naming Rules: 1. Must begin with a letter (a - z, A - B) or underscore (_). 2. Other characters can be letters, numbers or _ only. 3. Variable names are Case Sensitive. 4. There are some reserved words which we cannot use as a variable name because Python uses them for other things. These are: and,del,from,not,while,as,elif,global,or,with,assert,else,if,pass,yield,break,except,import,print,break,except,import,print,class,exec,in,raise,class,exec,in,raise,continue,finally,is,return,continue,finally,is,return,def,for,lambda and try. http://www.programr.com/python-variable-naming-rules General Naming Conventions for Java. Names representing packages should be in all lower case. Package naming convention used by Sun for the Java core packages. The initial package name representing the domain name must be in lower case. Names representing types must be nouns and......

Words: 723 - Pages: 3

Researching Variable Naming Rules

...What are the variable naming rules of Visual Basic, Python, and Java? List 3 similarities and differences in between the three programming languages. In Java, naming conventions for identifiers have been established and suggested by various Java communities such as Sun Microsystems, Netscape, AmbySoft etc. • The Classes names should be nouns in UpperCamelCase, with the first letter of every word capitalized. Use whole words — avoid acronyms and abbreviations (unless the abbreviation is much more widely used than the long form, such as URL or HTML). • Methods should be verbs in lowerCamelCase; that is, with the first letter lowercase and the first letters of subsequent words in uppercase. • Variable names should be short yet meaningful. The choice of a variable name should be mnemonic — that is, designed to indicate to the casual observer the intent of its use. One-character variable names should be avoided except for temporary "throwaway" variables. Common names for temporary variables are i, j, k, m, and n for integers; c, d, and e for characters. Local variables, instance variables, and class variables are also written in lowerCamelCase. Variable names should not start with underscore (_) or dollar sign ($) characters, even though both are allowed. Certain coding conventions state that underscores should be used to prefix all instance variables, for improved reading and program understanding. • Constants should be written in uppercase characters separated by......

Words: 294 - Pages: 2

Researching Variable Naming Rules

...Research Assignment 1: Researching Variable Naming Rules Variable Naming Rules of Visual Basic * The first character must be a letter. * The usage of spaces, period (.), comma (,), Exclamation mark (!), or the characters @, &, $, # in the variable name are not allowed, but the underscore (_) is a valid character. * The name must be less than 256 characters in length. * You cannot use any names that are the identical as the functions, statements, and methods in Visual Basic. Variable Naming Rules of Python * The first character of the variable name must begin with a letter (a – z, A – Z), or an underscore (_). * The name can only consist of letters, numbers, and underscores (no special characters). * Variable names are case sensitive. * The variable name cannot be identical as a reserved name in Python due to the fact that Python uses them for other things. Variable Naming Rules of Java * Variable names are case sensitive. * A variable name can be any length as long as it is within the Unicode letter and digit standard, also you should use a letter as the first character of the variable word. You are allowed to use the dollar sign or underscore ($, _ ) as a first character but it isn’t recommended. * The only characters other than letters and number that can be used is the dollar sign and underscore (“$”, “_”), and no other special characters may be allowed. * If you are only using one word for the variable name it is......

Words: 702 - Pages: 3

Pt1420

...ALONZO DARGAN (17186943) PT1420 Computer Programming Unit 7 Assignment 1: Homework 7 May 2014 Short Answers Page 213 1-5 1. Why should you indent the statements in the body of a loop? Because by indenting the statements in the body of the loop you visually set them apart from the surrounding code. This makes your program easier to read and debug. 2. Describe the difference between pretest loops and posttest loops. A pretest loop means to test its condition before performing an iteration A posttest loop means it performs an iteration before testing its condition. 3. What is a condition-controlled loop? A condition-controlled loop uses a true/false condition to control the number of times that it repeats. 4. What is a count-controlled loop? A count-controlled loop repeats a specific number of times. 5. What three actions do count-controlled loops typically perform using the counter variable? 1) Initialization: the variable is initialized 2) Test: the loop tests the variable by comparing it to the maximum value 3) Increment: to increase the value during each iteration the loop increments the counter variable by adding 1 to it. Algorithm Workbench Review Questions 1,2,7, and 8 p. 213-214 1. Design a While loop that lets the user enter a number. The number should be multiplied by 10, and the result stored in a variable named product. The loop should iterate as long as the product contains a value less than 100. A- Declare number as integer ...

Words: 721 - Pages: 3

Variable Naming Rules

...PT 1420 U2R1: Researching Variable Rules The following rules should be observed when naming procedures, constants, variables, and arguments in a Visual Basic module: * A letter must be used as the first character. * A space, Period (.), exclamation mark (!), and the characters, @, &, #, cannot be used in the name. * 255 characters is the maximum amount of characters a name can contain. * Names should not generally be the same as functions, statements or methods. Keywords from the language end up being shadowed. To use an intrinsic (natural, or essential) language, function, statement that happens to conflict with an assigned name, it must be explicitly identified; one must precede the intrinsic command with the name of the associated type library. For example, if a variable is named, “function,” one must use “VBA.function,” to invoke the function used in a name. * Visual Basic isn't case-sensitive, but it preserves the capitalization in the statement where the name is declared. When using Python the variable naming rules apply as such: * Must begin with a letter (a - z, A - B) or underscore (_) * Any 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. These words consist of: and, del, from, not, while, as, elif, global, or, with, assert, else, if, pass, yield, break, except...

Words: 616 - Pages: 3

Pt1420

...PT1420 - Midterm Study Guide Study online at quizlet.com/_cl08u 1. ...: How many times will this loop iterate Set = 1 While i 5 Display i end while 22. List three examples of application software: Microsoft Word Adobe Photoshop Microsoft Visual Studio 6. ...: How many times will this loop iterate Set = 1 While i Great Then < Less Then >= Greater Then or Equal 7 is false 5 < 7 Is True (5 > 7) or (10 > 3) is True (5 > 7) and (10 < 3) is False NOT (5 > 7 ) and (10 > 3 )is true because the NOT reverses the False Age < 10 and age > 60 Will never be true 55. What is the term that describes the part of the program that a variable can be accessed?: Scope What is the truth table for AND?: True AND True = True True AND False = False False AND False = False False AND True = False 34. 35. 56. 36. 57. What is the truth table for OR?: True OR True = True True OR False = True False OR False = False False OR True = True 58. 59. 60. What is the value of 2^3?: 2 2 2 = 8 What is the value of 4^2?: 4 * 4 = 16 What is the value of the expression 10-4*3/2+5?: 9. Multiply first, then divide, then subtract and finally add. What is used to check the relationship between two values?: Relational Operator What is used to translate high level language programs to machine language (or machine code)?: Compiler What makes a computer useful for everyday tasks?: Application Software What was the first programming language designed to perform complex math functions?:...

Words: 779 - Pages: 4

Pt1420 Unit 2 Research

...PT1420 Unit 2 Research Variable names should be short yet meaningful. The choice of a variable name should be mnemonic — that is, designed to indicate to the casual observer the intent of its use. One-character variable names should be avoided except for temporary "throwaway" variables. Common names for temporary variables are i, j, k, m, and n for integers; c, d, and e for characters. Local variables, instance variables, and class variables are also written in lower Camel Case. Variable names should not start with underscore (_) or dollar sign ($) characters, even though both are allowed. In Java, naming conventions for identifiers have been established and suggested by various Java communities such as Sun Microsystems, Netscape, AmbySoft etc. The Classes names should be nouns in upper camel case, with the first letter of every word capitalized. Use whole words — avoid acronyms and abbreviations (unless the abbreviation is much more widely used than the long form, such as URL or HTML). Methods should be verbs in lower camel case; that is, with the first letter lowercase and the first letters of subsequent words in uppercase. Certain coding conventions state that underscores should be used to prefix all instance variables, for improved reading and program understanding. Constants should be written in uppercase characters separated by underscores. Constant names may also contain digits if appropriate, but not as the first character. In Python its recommend to......

Words: 291 - Pages: 2

Pt1420 Unit 2 Research

...Kelli Okuly PT1420 Unit 2 Research Assignment 12-5-2014 Variable naming conventions vary from program to program. In Visual Basic the variable must begin with a letter and you cannot use a space, period (.), or the characters !, @, &, $, # in the name. Visual Basic variable names must be under 255 characters long. 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 a basic language function, statement, or method that conflicts with an assigned name, you must explicitly identify it. Precede the fundamental 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 use the “Left” function using “VBA.Left”. In Python, variables must begin with a letter or underscore (_). Other characters can be letters, numbers, or the underscore. Python variables are case sensitive and can be any length, within reason. There are several keywords in Python that are reserved for other functions and cannot be used as variables. For example; print, def, from, not, and return. Variables in Java are referred to as Identifiers. In Java the variable must begin with a letter, an underscore, or a dollar sign ($) although a letter is typically what is used. The other characters may be letters or numbers, no spaces or special characters are allowed. Java identifiers can be any length......

Words: 405 - Pages: 2

Researchig Variables Naming Rules

...Azure Hansen Unit 2 Research Assignment 1: Researching Variable Naming Rules PT1420 Introduction to Programming 1-8-2015 What are the variable naming rules of Visual Basic, Python and Java? Visual Basic * Unique within scope * <= 255 characters( other languages may have different length restrictions) * Begin with a letter * No embedded spaces or many special characters (.,”-$#* and others). The underscore_ is valid character. * Use upper and lower case with purpose. Once a variable is declared you do not have to be concerned with upper/ lower case. ( use of upper and lower case differ between languages.) * It is always good programming practice to use names that are descriptive or mnemonic. 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 * Some reserved words which you cannot use as a variable name because Python uses them for other things. 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. * Uppercase characters are distinct from lowercase......

Words: 330 - Pages: 2

Variable Naming Rules

...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.  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. 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. Uppercase characters are distinct from lowercase characters.  Using ALL uppercase letters are primarily used to identify constant variables.  Remember that variable names are case-sensitive. You cannot use a java keyword (reserved word) for a variable name. List three similarities between the three programming languages.   1. Must begin with a letter of the alphabet.   2. There are certain keywords that cannot be used.   3. The length of the name can be any reasonable length....

Words: 274 - Pages: 2

Itt Technical Institute Pt1420 Unit 2

...David Camacho PT1420 Programming Lab 2.1 Display Welcome to the Fiber Optic Calculator Program. Enter company name. Enter the number of fiber optic cable needed. Multiply .87 times the feet needed for the total cost. Display the total cost of the fiber optic cable and the company name. Purpose of Variable | Variable Name | Stores cost of fiber | fiberCost | Stores the company name | firstChoice | Stores the number of feet to be installed | 50 | Stores the calculated cost of installed fiber | .87 | Display “Welcome to the Fiber Optic Calculator Program” Set fiberCost = .87 Display “What is the company name?” Input companyName Display “How many feet of fiber will be installed” Input feetInstalled Set totalCost = fiberCost * feetInstalled Display “For the company” , companyName, “the total cost will be $” , totalCost David Camacho PT1420 Lab 2.2 Flowchart David Camacho PT1420 Programming Lab 2.3 Visual Studios Program David Camacho Unit 2 HW Assignment 1 Short Answer 1.What does a professional programmer usually do first to gain an understanding of a problem? The programmer creates a design for the program, which starts by asking the customer what they need the program to accomplish. 2.What is pseudocode? Pseudocode is an informal language that has no syntax rules, and is not meant to be compiled or executed. 3.Computer programs typically perform what three steps? Step 1: Input is received. Step 2:......

Words: 718 - Pages: 3