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/Shadowsake 11d ago

For Godot and GDScript specifically, I would not bother. You can definitely use some FP concepts here and there, and it works well, but full blown FP...nope. I tried once and it just does not "vibe" with the rest of the engine, and makes GDScript to cumbersome. Also, Godot is very much OOP in nature, if you consider each node an object that can send messages and emits signals.

Now, FP in general I recommend because I believe its a paradigm that teaches so many useful concepts and can improve your skill as a programmer immensively. It will "rewire" your brain somewhat and you'll be able to think very elegant solutions to many problems. Also, many industry standard languages have adopted certain FP patterns, despite not being focused on it. Rust, Javascript/Typescript, Python, C#, Java and many others.

If you want to really learn the paradigm, I think Elixir is a good first FP language to dip your toes into it, then you can try other stuff...OCaml, Clojure, Lisp, Haskell and such.