Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> However, OOP fundamentally results in a combinatorial explosion of state

Eh, no it doesn't. I think you need to expand on that statement because it isn't remotely true in my experience.



I've now expanded on that statement. In my experience, working using OOP in large multi-million line codebases, the state issues have proven very true.


How can you know that without comparing the same programs with a FP version? What if those codebases would become messy even with FP simply because the problem they are trying to solve is difficult? Also in what way does OOP prevent you from writing the code in a FP-style? It doesn't because the concepts FP and OOP are orthogonal.


It is much harder to do functional programming in an OOP language, as one is often fighting the syntax, semantics and various defaults. For example all variables are typically by default mutable, null in every type, libraries and frameworks with pervasive mutable state etc.

Granted it has been getting easier as OOP languages have been slowly getting more and more functional features. But it really is easier to favour immutability and composition in a functional-first language.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: