What are a modular framework, oop, metatables and promises

What is a modular framework, how does it work, how to use it, why would you use it ?
What are oop, metatables and promises, what do they have to do with modular framework ?

1 Like

OOP is programming with objects (like classes) pretty much, you’d use it to make your scripts more readable, but it’s not necessary to use OOP and metatables are a way to modify the functionality of tables (everything is simplified in this sentence). No idea how to explain the other stuff.

If anything is factually wrong then lmk, I’m always eager to learn more.

A modular framework is a organizational structure for programming. It allows you to easily separate out different systems.

Once your projects become too complex it becomes impossible for anyone to work on it if all of the code is inside very few scripts. Modules allow you to separate and organize out anything that you want.


From Link Below

Intro to Module Scripts

Some people learn better if attached to a fun lesson. I highly recommend this one, this guy also reviews the basics if you don’t get those yet.
(Module stuff starts at 19:13)
__
The rest of this stuff can get pretty complex, I would not start trying to learn this until you’re ready.

oop or Object Oriented Programming is a lot more complex in lua then other languages. In lua oop requires the use of metatables. Essentially what it lets you do is create your own custom objects.

You know how you can do Part.Color = Color3 well, using using oop you can make your own anything. Want to change how much damage something does, well if you set it up right you can just do CustomObject.Damage = 9000

Here’s a great introduction!
__
Metatables

Here’s a great introduction

__
Promises are a way to handle yielding.

If you have code that’s fetching saved data from a datastore it takes some time for roblox to fetch that info from it’s datastores, while that’s happening you don’t want your thread to sit there waiting for it to finish, it has other things to do.

If you’ve ever used spawn or coroutines you`ll have an idea of what this is doing.

Promises is the best way to handle this process. Here’s a great implentation and explanation of promises.

1 Like

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