3 ms·
> Data is more important than code Nope. Right there at the beginning is where the author goes off track. Computation itself is the most important aspect of c
by corebit 8y ago
> Data is more important than code
Nope. Right there at the beginning is where the author goes off track.
Computation itself is the most important aspect of computing. Code and data are just complexity to manage.
> Do I have a Customer? It goes into class Customer. Do I have a rendering context? It goes into class RenderingContext.
I whole heartedly agree with this. The naive approach to domain modelling is to classify the primitives of a domain into classes and stop there. In actuality, the processor of those primitives is likely what your class should be, and those primitives ought to be methodless data structures.
I.e., OrderFulfiller instead of Customer and Part classes.
- matwood 8y agoI disagree. SICP says "“In programming, we deal with two kinds of elements: procedures and data.” If we reduce that further it is really just data.
- corebit 8y agoThere is no one without the other. The data is unintelligible randomness without some algorithm to process it The code cant exist without some data schema to reference and has no value if there's no data instances to process.
- coldtea 8y ago>Computation itself is the most important aspect of computing. Code and data are just complexity to manage. Of course you're gonna write some computation, else there would be no program. That's not the point here. First, author doesn't mean "data" as in what comes in, it means the data structures of a program. Second, for the purposes of designing a program (and its computation part) data structures are a better guiding principle than objects. That's the argument being made.
- coolaliasbro 8y ago"I whole heartedly agree with this. The naive approach to domain modelling is to classify the primitives of a domain into classes and stop there. In actuality, the processor of those primitives is likely what your class should be, and those primitives ought to be methodless data structures." This is what I did not have the ability to articulate as well in an earlier comment. As far as I understand parent, the takeaway is that often OOP goes astray when the developer is unable to identify that a given need can be handled by generics/a parent class and instead instantiates their own class.