Search code examples
programming-languagesglobal-variables

Which languages do not have Global Vars?


Due to a wave of criticism to use Global Vars in my Java post, I want to use a language without global vars. One suggestion per answer, thank you.


Solution

  • If you don't want global variables then don't use them. I'm don't see why finding a language that doesn't support them would offer any value. You're dealing with a question of scope. Make your variables exist in the lowest scope possible and you'll be fine. There is no language that doesn't have a global scope.