Should I use roblox built in objects or object oriented programming such as intvalue to datastore?

I recently read up on object oriented programming and I wanted to give it a try. The thing I am wondering is if it’s worth to use OOP instead of built in objects to datastore. What are the benefits of it and how is it better?

Additionally, using roblox built in objects such as intvalue, boolvalue to datastore works fine. So should I continue using this method? Also, are there any better methods in terms of efficiency and code maintainability?

Depends on your style of programming.

I’ve abandoned objects like this in favor of attributes:

local gun: Part= game.Workspace.Part

function reload()
    local reload_time: number = gun:GetAttribute("ReloadTime") or 20
    task.wait(reload_time)
end

function main()
    shoot()
    reload()
end

OOP is great if you need to implement a structure to your code that’s shared between objects. A gun system would suit OOP. This is a good guide to OOP.

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