Question About Metatables

I finally figured out how to use metatables and want to consolidate my understanding.

Tell me, please, do I understand correctly that metatables are an OOP that makes working with Roblox Studio easier, but is not a necessary function, just a relief?

That is, metatables are a universal class for default data, right?


Nuh uh. OOP is a paradigm, or a “methodology”, for coding. It is one of many different standards you can use. OOP has its strengths and weaknesses, and that’s something you should understand before you try making everything object-oriented and praise it like a deity.

Some people choose to use OOP because they are already familiar with it; maybe they came from Java or some other OOP languages. Maybe they just like the philosophy of working with objects. But some others completely despise OOP and will do everything to avoid it. Some others use OOP with other paradigms and switch whenever it’s convenient for them. It really depends on you. Do not rely on other people’s opinions, you have to make the decision yourself. But first, do really understand what it actually is and what it actually means for programming.

1 Like

Thanks for the answer. As I understand it, metatables are still a universal class, but you can use it at will, right?

Yeah metatables are pretty much the only way to make classes and do anything OO in Lua

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.