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

> Obviously Rust is in the 4'th school which I like to call "The Rust School".

Ha! But yeah, if you're going to claim Rust is OOP, I would argue that makes the most sense.

> what really matters is that Rust gives you:

Right, this is the "Java School" definition. However, when people talk about OOP this way, when they say "polymorphism", they mean "subtype polymorphism" not "parametric polymorphism." Take https://docs.oracle.com/javase/tutorial/java/IandI/polymorph... as an example. Rust's only sub-typing is for lifetimes.

> As fun as the PL theory discussions are.

I definitely agree that in some senses, this is academic. But at the same time, practitioners can be mis-led by using terms in a different way than they're used to. This is sort of the argument I'm making above; since many practitioners see "polymorphism" as being equal to "subtype polymorphism", calling other types of polymorphism "polymorphism" is a more academic, less user-focused distinction.




Oh dear. That java tutorial just reads wrong to me but that's probably because I've been burned too many times by conflating polymorphism with code reuse in the form of inheritance.

I think the working programmer doesn't know or care though. They care about whether you can reuse code in some way. And whether you can substitute multiple implementations of an object act as one particular type.

The specifics of how you reach either of those goals is all they want to know and the pedantry that us language geeks love to engage in just blows right past them.


It's possible we've just interacted with different people; I've spoken to a lot that assume inheritance, specifically, and we get questions about it often.

Anyway, thanks for a good discussion!


It's highly possible. I almost never get to work with people who geek out over language theory :-D

I have to come to HN for that instead.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: