4 ms·
Because classes are the poor man's closures?
by Shorel 13y ago
Because classes are the poor man's closures?
- base698 13y agoStructs are the poor man's classes.
- btilly 13y agoNo, because if you're starting with OO as implemented in any particular language then you can never get to insights like http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-18.html#footnote_Temp_289 http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-18.html... which, since I know people won't follow the link, I'll quote from: Developing a useful, general framework for expressing the relations among different types of entities (what philosophers call ``ontology'') seems intractably difficult. The main difference between the confusion that existed ten years ago and the confusion that exists now is that now a variety of inadequate ontological theories have been embodied in a plethora of correspondingly inadequate programming languages. For example, much of the complexity of object-oriented programming languages -- and the subtle and confusing differences among contemporary object-oriented languages -- centers on the treatment of generic operations on interrelated types.
- 3rd3 13y agoI don’t quite get the last bit. Why is "centering on the treatment of generic operations on interrelated types" inadequate? Do they talk about the tree-like structure of inheritance which might be useless in scenarios where the relations can be better modelled by an arbitrary graph? Also, why would studying OO first be narrowing my ability to learn different paradigms?
- route66 13y agoAbout the last bit: http://en.wikipedia.org/wiki/Covariance_and_contravariance_%28computer_science%29#Need_for_covariant_argument_types.3F http://en.wikipedia.org/wiki/Covariance_and_contravariance_%... is probably one of the issues.
- btilly 13y agoIt is, although programmers have mostly working solutions that they are used to for that one.
- btilly 13y agoI don’t quite get the last bit. Why is "centering on the treatment of generic operations on interrelated types" inadequate? Go to the link, and find what it was a footnote on. You'll be reading through a section that is attempting to make operations like addition work in a reasonable way across different numeric types for an abstract math package which needs to support integers, rationals, floating point, complex analogs of all of the above, polynomials over all of the above, and lots of other fun stuff.. Do they talk about the tree-like structure of inheritance which might be useless in scenarios where the relations can be better modelled by an arbitrary graph? Look at http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-18.html#%_fig_2.26 http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-18.html... for a set of different geometric types that is challenging to model with inheritance. Also, why would studying OO first be narrowing my ability to learn different paradigm? Because your mind naturally goes through prepared channels. If you've got OO available to you, then you naturally solve the simple versions of problems with OO. Then when you get to the subtleties of the complex version that your form of OO doesn't work well for, it is hard to see that OO isn't a good fit, rather than being trapped into thinking that you just chose a poor initial model.
- wonderzombie 13y ago"When will you learn? Closures are a poor man's object."
- Shorel 13y agoThat's the answer I expected ^_^