Help with Object Oriented Programming

I’m not sure if Object Oriented Programming is deprecated by many people or not, because there are almost no tutorials on Youtube or the Developer forum on how to use it correctly. I know all the metatable and metamethod stuff, but I don’t know how to implement that directly into my game. Also, isn’t OOP basically procedural but with classes and methods, because you are calling methods in a procedural way?

Other questions:
Can you mix OOP with procedural?

Do most popular games on roblox use OOP?

Is it recommended to use it for EVERYTHING, like datastores, client side, etc

There’s a good guide by @magnalite

1 Like

There is no proper way to use OOP and you do not have to necessarily use metatables for a code to be called “OOP” (even though they do help you a lot). OOP is a way of writing code using the idea of objects to represent data and methods. OOP cannot be deprecated. Because of the way OOP is designed, it helps the developer by allowing for code to be easily reused by other parts of the program or even by other people. This is strongly arguable though, some people do not like OOP. I personally do. As @xuefei123 said you should probably give this a read. It should clear any confusion to you.

OOP is just another paradigm, which you shouldn’t stick to 100% of the time. Each paradigm has its use and purpose which isn’t cut for every task. Personal distate of it here, and you should look at its pros and cons closely.

1 Like

Thanks, I have already read that post, but when I re-read it, things became a little more clear.

Of course.

That is up to the developers, using OOP won’t magically make your game better. People have their own preferences on writing their code.

Using OOP won’t change the way your code functions, if you like using OOP, use it.

Thanks this cleared things up.

I usually just use OOP whenever I believe it will use up less time and code (less code usually makes it easier to read for me)

1 Like