For the past several years I’ve been coding on Roblox, my approach has been purely of functional programming. I wanted to get into OOP and using class-based systems, but a friend of mine says that it’s not worth the hassle for classes. With that, I wanted to open this thread and ask about class based systems with some questions. I understand answers may vary depending on who is being asked, but personal experiences are enough for me to get the point and try something new.
- What is the benefit of using a class-based system or OOP over functional programming?
- Where should I use class-based systems? Where should I use functional programming?
- How can I avoid this supposedly “evil concept” of “premature optimization”? What even is it?
- How do I get started on creating a class-based system?
I tried to get into modules so I could possibly train into OOP/class-systems, but it hasn’t worked. I’ll probably require an explanation as if I was 5 years old. I would also appreciate some tips on that thread - it’s about using modules in code.
Often at times people say “use modules” but I don’t understand why. You can achieve the same thing that a module can do in regular scripts.
- What’s the purpose of modules?
- Why use modules?
- How do I use modules?
- What’s the purpose of stringing modules to make a programming system or game engine?
My own implementation literally just recursively requires things and it seems pointless. Modules seem pointless to me. At the same time, I want to try improving my code base so it doesn’t only not look bad, but so it’s actually efficient, well-rounded, easy to use and not too hard to maintain.
Essentially: my mind is wrought with thoughts about how I’ve set up my code base and how I code and I feel like I need to learn something different or learn it all again. I’d like to know functional versus object-oriented in as much depth as I can so I can determine how I move forward. One thing that prevents me from developing is stupid insecurity about my code.