DEV Community

Discussion on: Is Object-Oriented Programming "Dangerous"?

Collapse
 
sebbdk profile image
Sebastian Vargr • Edited

I think a lot of the "controversy" comes from not understanding the basic problem.
Which is state-management.

OOP was design to help manage state in a time when the issue was quite new.
It does this by grouping state in objects, this organization comes at the hefty price of lots of bootstrapping code. But at the time it was implemented it was revolutionary. The result was Java, C#, C++ etc..

FP does away with all that bootstrapping and suggest just writing the bare-bones of what you need and then passing state along as needed. State is then only kept at the code entry point and then passed along.

This video goes over the history of state-management fairly well imho:
youtube.com/watch?v=QM1iUe6IofM

The question really should be, what idea-set is best of managing state?


IMHO it is FP, since it takes most of that pesky bootstrapping away, which enables code-reuse, testing, librarization and verbose action oriented code.

On top of that, you do not need as much specialization in your language to support FP. Which takes loads of complexity away.

In theory FP concepts could be applied in Basic using goto...