3 ms·
Objection 1: Given a queue, priority queue, and stack, how do those data structures "just exist", without the behavior associated with them? The interactaction
by stonefarfalle 8y ago
Objection 1:
Given a queue, priority queue, and stack, how do those data structures "just exist", without the behavior associated with them? The interactaction with them is their defining characteristic.
Objection 2: I agree not everything should be an object. However where do you draw the line? To me a timestamp is a perfectly reasonable object. I can see the pros and cons of "3" being an object as well.
Objection 3: I like things to be organized. What benfit do I get by jumbling everything together in one spot?
Objection 4: Yes they do, pretending they don't doesn't help. Even in Haskell, files and sockets are represented as an opaque handle to hidden state. It very much looks like a OO interface in a non OO language. Given the three data structures in objection 1, hiding the state allows for a smaller surface area to prove that the data structures are correctly implemented. Allowing random access to their state does not improve them.