News for hackers. Stuff that matters.
Re:Why I want Concepts, sooner rather than later by EGreg on Sunday February 21, 2016 @09:05AM (#11144521)
It's just a tool. OOP is basically the same as

  Classname_method(&structure, ...)
Inheritance is a good fit when you want execution efficiency when implementing interfaces. It makes you think in terms of base behavior vs customization and thereby re-use code properly. Most of the time, the resul is that the base class implementation is generic enough to do what you need regardless of the specific instance. But if you really need to override base behavior, that's when you can have things layered on top of basic inheritance.

For example:

* Database access (ORM or NoSql)

* Any sort of server object access (eg File, Request, Socket)

* APIs that discourage duck typing to increase cohesion

* Low level implementations that need efficient implementations of function calls

* Automatic, zero-overhead memory management http://www.stroustrup.com/resource-model.pdf

Re:Why I want Concepts, sooner rather than later by jstimpfle on Sunday February 21, 2016 @02:41PM (#11146109)
Duh. that paper is... long. And it mentions inheritance 0 times.

Maybe compared to duck typing inheritance increases cohesion. But classes in practice most often discourage cohesion. That's why they came up with Aspect-oriented programming. Not that that is practical, but it comes from the insight that organisation as stateful objects naturally leads to coupling, since you must lump most functionality into one mostly closed concept. And the odds are your next class will have a very similar structure regarding dependencies and implementation. And then you end up with inheritance just to share code, and end up with these totally meaningless ball-of-mud inheritance structures.

> Low level implementations that need efficient implementations of function calls

I'm pretty sure the most efficient "implementation" of function calls are still function calls.

Re:Why I want Concepts, sooner rather than later by EGreg on Sunday February 21, 2016 @03:46PM (#11146426)
I meant method calls