News for hackers. Stuff that matters.
Re:Was object-oriented programming a failure? (2015) by eveningcoffee on Sunday March 12, 2017 @06:54PM (#13853713)
One of the core principles of the OOP is encapsulation - your object does not appear in inconsistent state to the outside world. So in sense of the OOP, object methods are all the functions that can have access to the internal state.

Naturally you can do the same in FP with modules, but honestly, how different it is from OOP then (considering that you can use some form of polymorphism)?

For me OOP and FP stand for abstract concepts, not as specific languages.

Re:Was object-oriented programming a failure? (2015) by naasking on Sunday March 12, 2017 @09:23PM (#13854512)
> One of the core principles of the OOP is encapsulation - your object does not appear in inconsistent state to the outside world.

This is not a defining feature of OOP, because it's a characteristic of abstract data types which predate OO. William Cook managed to distill the essence quite clearly I think [1].

[1] http://www.cs.utexas.edu/~wcook/Drafts/2009/essay.pdf