0
Why senior developers write two words like this MAX_VALUE and not like this MAXVALUE.
Even I have seen that they declared a variable for list like this _LIST and deleted this LIST tell me any reason
4 Respuestas
+ 3
Because second variant is more readable. It's a good practice
+ 3
In Python, there is a datatype called list.
If you write:
list = [1, 2, 3]
Then you overwrite the name for the datatype list and can't use it anymore.
So you change the name just a bit.
list_ = [1, 2, 3]
+ 2
The reasons is as follows: first : There are rules to write (variables). If you have long variable like Max value you should put underscore instead space.
Second : Helps the programmer to read and modify the code.
Third: you can search about how to write the variables. Most of the programming languages have the same rules.
And Some word is Reserved word you can not use such as List in python and some programmer write List_ in this case you can use it.
0
Timur Myngbay does it makes code faster, as it is more readable