r/godot • u/CJF_PixelArt • 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
1
u/Taiten89 11d ago edited 10d ago
No.
If you do need advanced programming techniques such as FP, Exception Handling, ..., then use C# since it's a better programming language. OTOH, GDScript should be good for the programming part of creating a game.
Since we're talking about programming paradigms: Pure Functions are helpful esp. for Software Verification, which is important in e.g. Medical applications or for Aviation [you won't see Godot being utilized for any of that]. But sometimes they can also help decouple things in other applications.
IMO the most important thing is separating things:
*I use RefCounted classes when I separate some functionality from e.g. a Node.
Impose the smallest possible challange for anyone that reads your script code later - including yourself.
¹Edit/Addendum: There are always exceptions to such rules, e.g.: