Is it ever ok to use _G?

There’s never a case where _G should be used anymore. I’d recommend staying as far away from it as possible.

Programmers might avoid working with you and might even not take you seriously for using _G

You can use a ModuleScript, Attributes or CollectionService instead that’s what they are for

A few good reason to avoid _G:

  • No intellisense
  • Key and Value might not exist upon indexing
  • Hard to debug magical table
  • Less performant than other alternatives
16 Likes