Hacker News new | ask | show | jobs
by shady-lady 3338 days ago
Well, not really.. In effect, your class owns the relevant piece of data that it operates on and only allows pre-defined operations on that data.

Maybe my point is better articulated by saying [to me,] functional programming is more data oriented than OOP.

1 comments

The word "own" is pretty meaningless. What does "own" even mean? Classes and objects (thought of as "types") are an organizing principle for organizing your functions. If you didn't organize them in this manner, then you'd have the same functions that operate on the same data types, only they're scattered everywhere, just like in functional programming.
> the same functions that operate on the same data types, only they're scattered everywhere

???

OO is different because you have things like private variables. Meaning that only methods of an object's class can access the variable. So you now have a special group of functions that can access the variable. FP is not like that.