I’m just curious, what’s the difference between _G
and shared
? Don’t they do the exact same thing?
There is almost no difference, but _G you can get faster
Like type faster? Or get data faster?
Shared provides the exact same purpose of _G. There is no difference.
Just that they’re in different scopes.
And this and that
And by the speed of receiving, and by the speed of writing
What is your source and how do u know this?
No one forbids you to enter the studio
From personal experience, and not only
uh did you try it with tick or what
You can’t magically know the difference of speed. What’s the difference between the speed of light and the speed of light?
Yes, I tried using tick (), I repeat, you can check it yourself in the studio.
They’re both globals that point to a table. They share the exact same function, purpose and setup - think of local tbl = {}
but it’s not local.
There’s no reason to be using the global table in 2022, or any kind of global for that matter. They carry an assortment of practice problems that you don’t want in your code – namely race conditions (code executing before keys are put in the tables) and namespace collisions. Use ModuleScripts if you need to share state and variables between scripts.
print(_G.shared) --nil
print(shared._G) --nil
Inappropriate to the question above: ">. But still I will answer your question. The whole is nothing.
Think of it as tables but not local as @colbert2677 said. But they’re different tables. And they are both for same purposes
Then why do they still exist and are not deprecated?
Cuz it’s a cool global. Why would they deprecate it lol
What is this answering? That’s like saying:
local table1 = {}
local table2 = {}
print(table1.table2)
print(table2.table1)
Neither of them have any values. Your code doesn’t help.
Why is it “cool” if it has problems?
It dosent have problems, it just a bad scripting practice
But I just could do _G.table1
and _G.table2
or shared.table1
and shared.table2
… I don’t see a reason for two things that do the same thing and that you can just put two tables in either global thing instead of using two global things.
Then yet again, how is it “cool” if it’s bad practice?