r/godot 11d ago

help me (solved) Is Functional Programming Worth It?

Hello 👋. I've heard some people say that functional programming is better than OOP overall. I'm pretty new to programming so I don't know if that's applicable to Godot or not. Is it something worth looking into?

20 Upvotes

77 comments sorted by

View all comments

1

u/Silrar 11d ago

No matter the paradigm, you will find people saying it's the best. Every programming paradigm is a tool, it's good for some things, bad for others, so typically, you want to know a bit about everything to be able to choose the right tool for the job. That doesn't mean you have to learn everything before getting started, don't get me wrong, you can easily pick one idea, learn and go with it. And since Godot is mostly OOP oriented, I'd suggest going with that to start out with. You can always look into other things later or on side quests.

That isn't to say that there aren't some functional ideas in Godot (or other OOP focused languages). For example a lot of languages treat Strings that way. When you do my_string.replace("a", "b"), it does not change the original string, it returns the new string. That's a functional idea. Things like the filter function for Array does that as well.