+ 9
In most of the programming language while declaring a variable special characters other than underscore (_) is not allowed .Why
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.
+ 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.
+ 5
because in programming other than underscore most of the special characters have different special meanings
+ 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