+ 3
Can you have an object have the same name as a variable?
8 Respuestas
+ 3
the better question is probably "should you have an object with the same name as a variable" lol. to keep things legible and to manage future confusion, probably best to make distinct names if possible.
+ 3
The answer varies depending on which language are you working on
+ 2
Depending on the language, an object is a type of variable, just like integers, arrays etc are.
But the same is not so for key words.
+ 2
thank you for your help
+ 2
i appreciate it
+ 2
That would be based on the language you are working on. You can and cannot. But avoid any form of confusion and to improve readability of your codes; I'd advice you make 'em distinct.
+ 1
so if you use a case sensitive language and just change the case it would still work