Need some examples on how to use OOP (Object-oriented Programming)

Good day everyone!

Recently i noticed that my code is quite messy, and I did not like that. So, i looked back at OOP, but i never got a good grip on how to implement it, since it looks kind of overwhelming to me (for now).

I would like to ask you to give me some examples of where to use OOP and when is it necessary or not.

Thanks☀️

There are already tutorials explaining the use cases of Object Oriented Programming, and how to properly create it.

From 2014 (https://devforum.roblox.com/t/8585)
From 2022 (https://devforum.roblox.com/t/1639499)

Just because you can use it, doesnt always mean you should, its just a way of organizing code for a specific group of objects (referred to as “classes” , rather than a solution to cluttered code in general.
I would also advise that you look into your code before you try inplementing something such as OOP, because the solution is probably you needing to clean it up, or simplify your code.

2 Likes

How about you send some of your code and we can see if it even needs to be OOPtimized?