+ 2
What is use of global variables??
We use variable almost all languages like c c++ js php etc. Then why we can't use a global variables for all programming languages???
2 Respostas
+ 1
+ if there is global variable name1 you cant use this name in all programs in project for different usage. There is risk you think name1 is local but you change variable for others without you know it.
I saw global variable with name i in script language in bigger project, because some programmers declare i as local and other no there was strange situations.