r/programming • • Feb 23 '12

Don't Distract New Programmers with OOP

http://prog21.dadgum.com/93.html
207 Upvotes

288 comments sorted by

View all comments

Show parent comments

7

u/SirClueless Feb 23 '12

Historically, there is a much narrower definition of OOP than "objects, with behavior." Typically it means that there is some form of dynamic dispatch or late binding based on runtime type. There are other forms of polymorphism, yes, such as statically dispatching any object satisfying an interface to a given function (i.e. typeclassing), but this doesn't fall under the historical umbrella of OOP, even though it solves roughly the same problem.

1

u/greenrd Feb 25 '12

Typeclassing separates code from data though. That can be a good thing or a bad thing, but it's quite radically different from the conventional OOP ideal of "put your related code and data together".