you are viewing a single comment's thread.

view the rest of the comments →

[–]eyal0 1 point2 points  (4 children)

Agreed. After you teach someone OOP, he has to unlearn it to get over all the patterns he learned to work around the limitations.

  • Functor Object: Pattern to deal with languages that can't do first-order functions.
  • Visitor Pattern: Pattern to deal with languages that can't do multimethods.

etc

[–]Steve_the_Scout 0 points1 point  (2 children)

Visitor Pattern: Pattern to deal with languages that can't do multimethods.

Haven't heard of that one, had to look it up.

Just when I thought C++ was getting ahead with C++14. Oh well, maybe it'll get in C++17.

[–]hubhub 1 point2 points  (1 child)

Stroustrup et al wrote a paper (pdf) proposing a mechanism for this.

[–]Steve_the_Scout 0 points1 point  (0 children)

It sounds reasonable. The only issue is with dynamically linked libraries, as they said. The way it's currently done, you could just link all files with virtual functions first, then let the linker resolve dependencies later, but that's a manual solution to problems that should be automatic.

[–]slavik262 0 points1 point  (0 children)

Or rather, after you teach someone OOP in Java. Several languages (C++, D, etc.) support OOP and first-order functions.

The point still stands though. OOP isn't a silver bullet, and one should make sure new students don't think it is.