Hacker News new | past | comments | ask | show | jobs | submit login

I 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?




I 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... 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.


About the last bit: http://en.wikipedia.org/wiki/Covariance_and_contravariance_%... is probably one of the issues.


It is, although programmers have mostly working solutions that they are used to for that one.




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: