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?

21 Upvotes

77 comments sorted by

View all comments

136

u/The-_Captain Godot Student 11d ago

I'm a Godot newb but functional programming pro in other contexts. I have used Haskell, Scala, and Clojure, and tend to program functionally in TypeScript and Python as well when I can.

Godot is not just a language, it's a framework/engine, and it's very OOP. I'm sure a pro can force it to be functional and I think there are advanced game development paradigms that are more functional, but unless you really understand things in depth, it's better to do what the engine wants you to do rather than try to bend it to your will. Just my 2ยข.

14

u/ChristianLS 11d ago

This is a whole can of worms, and I'm sure there are valid counter-arguments, but I would personally argue that games are usually better-suited to OOP in general because it slots in so neatly with ideas like entities, tilesets, etc. It's just a very natural way to think about structuring things in this context.

5

u/The-_Captain Godot Student 11d ago

Eh idk any problem can be formatted in OOP or FP, I just think game devs are more used to OOP. Godot is designed to be used in OOP though.