4 ms·
OOP is not data first. Or noun first. Objects are different from data in the sense that objects are a combination of data and methods. In OOP the line between
by crimsonalucard 7y ago
OOP is not data first. Or noun first. Objects are different from data in the sense that objects are a combination of data and methods.
In OOP the line between data and verbs blur into a combination of the two called an object. The object is a primitive and if your primitive is a combination of data and function you cannot program things in a way that has data first. At least you can't do it without making the code awkward.
FP is not, despite the name, a verb first language. It separates verb and noun allowing you to choose to build a program in a way that is noun or data oriented while OOP does not.
Data is a noun that cannot do anything except exist. Functions are verbs that cannot do anything but change things. Objects are a combination that are neither and thus hard to do data oriented programming if objects in your code exist as primitive building blocks.
All this article is saying is make the data a primitive building block.
- mamcx 7y ago> Objects are different from data in the sense that objects are a combination of data and methods. So data are models, functions views and objects controllers?
- crimsonalucard 7y agoData are structs, arrays, tuples, variables, sets, enums, etc. Data structures.