re: What are the hardest programming languages you have ever learned? VIEW POST

re: A global variable is a variable that can be read and written from everything inside your application and it is awesome for saving states. Sadly, Ru...

Just initialize whatever you want to share in the main function and pass it in to where it's needed?

I'm sorry if I sound dismissive, it just really doesn't sound like a good idea.
Words like implicit dependency, side effect, singleton, and not thread safe come to mind.
Why touch something that wasn't passed into your function?

It's definitely not the same, I agree.
Can you give an example of when you'd want to use one?

code of conduct - report abuse