37,955 views
19 votes
19 votes
Why is it important to follow a consistent naming convention for variables?

because it is confusing to read code that uses variable names inconsistently
because a computer will attempt to execute instructions exactly as they are written
because a variable name cannot start with a number
because variable names cannot include special characters

User Eugene Manuilov
by
3.0k points

2 Answers

18 votes
18 votes

Answer: Consistency allows others to more easily understand your code.And cause Variables are to name something, so it can be easily remembered.

Explanation: :) (NOT copying)

User BlackWasp
by
2.3k points
9 votes
9 votes

Answer:

Variables are to name something, so it can be easily remembered.

Step-by-step explanation:

Variables can be used to rename something in a program by using a value, to make it shorter and easy for you and the computer to remember.

Variable = Value

Name = "Jason"

Jason is a string value being assigned to Variable.

Variables should be short and easy to remember:

Jason

This works.

JasonMichealJohnson

This is too long.

Variables should begin with a letter in the alphabet:

Vbux

This works.

10000000Vbux

This doesn't work. Too long and doesn't start with an alphabet.

Variables can contain letters, numbers, and some characters like an underscore. Not reserved characters. Use _ for more than one word in a variable instead of using space OR use uppercase letters to start each word with no space between words.

User Tmporaries
by
2.8k points