Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

When is it better to use Object-Oriented Programming?

I know this is not a request site, I am just looking for an example, if I have broken a rule then I apologize that was not my intention. I've recently looked over Object-Oriented Programming, and I was wondering when is it best to use that? And when is it best to use methods and such that are already in ROBLOX Studio?

1 answer

✓ Accepted answer

Well, it would be best to use Object Oriented Programming (OOP) if you're developing a game. This is basically the only use for OOP.

Every programming language can be used for different things. ROBLOX Lua cannot be used to make a website you can find with a search engine, but it can be used for a game on ROBLOX. HTML is for websites and can't be used to make a video game. So basically, OOP is best in games where objects will interact with other objects.


Now for ROBLOX methods, if there is a method ROBLOX gives you like :Destroy() or :FindFirstChild(), it's much faster and much more efficient to use these than to make your own code to do the same exact thing. It's also faster and takes less work. So simply, if there is a ROBLOX method to do something you're trying to code, best bet to use the ROBLOX method than something you're attempting to make.

2 comments

0

Thanks mate! Really cleared things up!

0

Anytime

This discussion is preserved as it was. New answers, comments, and votes are closed.