+ 9

In most of the programming language while declaring a variable special characters other than underscore (_) is not allowed .Why

7th Mar 2017, 3:49 PM
Athul Joy
Athul Joy - avatar
4 Respostas
0
Because if they were allowed, the compiler will have to check through an enormous library of error codes to make sure that your variable name isn't an error code. The resource required to do this doesn't justify the feature of enabling special characters in your variable names.
13th Jul 2017, 8:02 AM
Jessie Tijerina
Jessie Tijerina - avatar
+ 11
Because if they were allowed, the compiler will have to check through an enormous library of error codes to make sure that your variable name isn't an error code. The resource required to do this doesn't justify the feature of enabling special characters in your variable names.
7th Mar 2017, 3:59 PM
Hatsy Rei
Hatsy Rei - avatar
+ 5
because in programming other than underscore most of the special characters have different special meanings
7th Mar 2017, 7:21 PM
POJO
POJO - avatar
+ 2
most special characters are used for other function as well, that's why =, ^ etc aren't allowed, same reason they aren't allowed in file names, as well certain languages (Java for ex) has ways they handle unicode so that's not even possible, esp in comments, an easy mistake if describing a method in comments. one exception in many however is pi, you can use that in most, i just avoid them for simplicity
7th Mar 2017, 6:12 PM
William La Flamme
William La Flamme - avatar