3 ms·
You don't need to modify that data. The methods can produce other objects in which case OOP starts to look very functional, the main difference being that you l
by thisiszilff 7y ago
You don't need to modify that data. The methods can produce other objects in which case OOP starts to look very functional, the main difference being that you lead with the data (a.to_foo() instead of food(a)). There's a lot of different definitions of OOP and some of that is willy nilly state modification everywhere, but other parts of it are encouraging you to see what data is coupled together and to treat that as a unit, therefore helping you think at a higher level about what you're doing.