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

OOP puts state and behaviour togethet (tightly coupled) in objects. FP, in a language with expressive types, has well-defined data-only structures (types) and functions that operate on those structures, so state representation and behavior are separated.

For me, OOP can be done right, but FP is intrinsically better for correctness (it incentivizes correctness)



OOP puts data and behavior together in objects. Which is 100% compatible with functional programming.

It is mutability that is incompatible with FP, but mutability is a property of imperative programming, not of OOP.

It is even possible to have 100% purely functional Java, for example, if you just eschew mutability.




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

Search: