Variable name definition: The variable name consists of a letter, a number, an underscore, where the first character cannot be a number.
Explanation One, lexical analysis said (https://www.zhihu.com/question/19581495)
Because each time you enter the "head symbol" to determine whether the symbol is a number or a character, if it is a number, you can jump directly into the digital processing module, if the character is processed by the variable name. If the variable name is allowed to start with a number, then each time you enter a symbol to make a "whether is a number" judgment, until the symbol appears non-numeric and then turn into a variable name, and prohibit to start with a number only need to judge once, it is clear that "every time to judge" is a great waste. In addition, the variable name with the beginning of the number of the programmer also does not have any help, but lower the performance of the compiler, after all, O (1) and O (n) is not a small gap. Explanation Two, the existing data can not distinguish scientific counts: 1E3 Some values: 100000l,100f program logic error: int 1 = 2; if (1 = = 2) {...}
Why can't the variable names in the computer language start with numbers?