I’ve continuously been seeing a lot of things like “OOP is bad!” and other things similar to it, I’m confused if I’m doing something right. Just like my first post, I tend to use different paradigms depending on the situation. But I don’t know if this approach is “controversial” to some people, I’m just terrified if I’m doing something wrong with my Framework.
At the moment, I have a whole thingy where it helps solve the problem and readable, its good to me, unless theres major disadvantages to it.
This is probably a very hot topic in programmers but I just wanted to know your thoughts ;-;
In short: true oop does not exist in roblox and it’s unlikely that it will any time soon, if you want to use classes i suggest you wait until they are added to luau, which is supposed to happen very soon. Even then, things like inheritance won’t work still. The whole metatable oop is a glorified workaround that just tries to mimic the real oop. It works, but just wait for the actual classes to release
Your thinking of “as long as its readable and solves the problem” on this topic is valid.
There is a clear tradeoff to OOP - user-friendly but sacrifices performance. This is a design choice you need to make when using it.
They do have a point - use OOP in the right circumstances only. Straightforward/minimal code wins.
If performance is the argument, then personally I wouldn’t care so much unless it’s part of a truly massive system. I’ve coded a ~1000 line class for zombies, and I would say the performance isn’t even that bad. You be the judge: See game (you might have to wait for a while) + code.
there’s no true/not true OOP.
It’s either OOP or it’s not OOP.
Because OOP is a programming paradigm.
Though, as you said, luau does not support it.
But that has never stopped people who use other languages.
For example, open any C project in github and you will find their own runtime implementation that supports OOP.
Yeah, I often think this way too. As long as it doesn’t heavily impact Players it should be good in terms of performance. Unless ofc, as you mentioned, in a large system. Thanks for the reply : D
Probably the best reply I’ve seen so far LOL, I’ve went through with using different paradigms depending on the situation and often avoiding using “limiting” principles ones like doing small inheritance chains with the majority of it being composition.