r/functionalprogramming • • Sep 25 '23

Question Why OOP sucks?

4 Upvotes

81 comments sorted by

View all comments

Show parent comment

8

u/ISvengali Sep 26 '23

OOP is horrible for game engines, Ive been professionally working with them for more than 2 decades, and we started moving away from OOP back in the early 00s for a LOT of companies

That said, its heavily used in Unreal, which means its sadly pretty common

Heavy interfaces can be nice, but most things can be done well using other techniques, and OOP is really bad for most gameplay systems, and even relatively shallow hierarchies are bad for most systems.

2

u/ScientificBeastMode Sep 26 '23

Most of Unreal is written in a procedural style, not OOP, as far as I’ve been told by people familiar with its internals. I was told that they have some OOP stuff at the interface layer because that’s what average industry programmer tend to want, despite its disadvantages.

3

u/ISvengali Sep 26 '23

Ive worked with it heavily for 15 years

They heavily rely on hierarchies for large chunks of code which includes almost all gameplay code, but also the higher level rendering code using it for inheriting / overriding behaviour.

I completely rewrote the actor networking system to be faster and support larger number of simultaneous clients as an example of the type of work I have done.

Its not at all procedural with a light OOP interface.

Other engines Ive used have been like that, but theyre proprietary.