+ 18
Why only underscore (_) is being used in variable name in programming languages ?
Why only underscore has special place in programming languages why other symbol hasn't have ??🤔
21 Antworten
+ 15
It doesn't mean anything. It is rather a common naming convention for private member variables to keep them separated from methods and public properties.
+ 11
But double underscore(__) is reserved in some programming languages what about that?😒
+ 8
It's not a big issue but I think it's similarity to empty spaces makes it special.
+ 8
what will you have do?? to know😂
+ 7
Other symbols like + or * maynbe confused with operators.
+ 5
You are free to use anything as variable name.. lets test other possibilities:
Justtryusingnone
Or#try#using#other#signs
Maybe!this!looks!better
I_guess_I_will_be_using_underscores_again
+ 5
There are 3 naming schemes that are commonly used:
CamelCase in most object oriented languages
snake_case in cool languages like C and Python
kebap-case in the superior LISP
+ 4
Because all programming languages ignoring SPACE so... better understanding of variables names the underscores are useful
+ 4
No specific reason only identification of variables becomes easy 🤔
+ 4
Because underscore is not a reserve word we cannot use reserve words as a variable name subtraction sign(-) is reserved for subtraction that is why we cannot use it as a variable name sometimes we use underscore to make our variable in more human readable form ....like choiceinput to choice_input it is easy to read
+ 4
Because space is counted as a character in c++ but _ (underscore) or any other symbol are allowed in programming.
There are some exceptions in special symbols also..as they have special meaning called keywords
+ 3
Doesn't Python use "camelspace" e.g. MyVariableName instead of My_Variable_Name?
+ 3
The compiler in some languages will confuse a "-" as a minus operator.
+ 3
To increase readability....🙂
+ 2
Anything except whitespaces and numbers first like 1time onetime*
+ 2
In most languages, an underscore can be used as part of an identifier (variable name, function name, class name etc) as generally spaces are not a valid part of an identifier.
+ 1
Hi, What are you working on?