News for hackers. Stuff that matters.
Re:The Sororicide Antipattern by aetherson on Thursday June 01, 2017 @01:59PM (#14462731)
His argument against inheritance seems based largely on Python's weak implementation of private attributes. I mean, maybe he has an argument against inheritance in Python, or some versions of Python.

But if the only argument you have against inheritance is "private names may collide," well, like, computer science has you covered, dude.

Re:The Sororicide Antipattern by ubernostrum on Thursday June 01, 2017 @04:27PM (#14464254)
His argument against inheritance seems based largely on Python's weak implementation of private attributes.

No, it seems like a Python-based example of one of the well-known problems with inheritance, which applies even in languages like Java and C++ with explicit compiler-enforced visibility modifiers. Difficulty determining which class in a hierarchy is responsible for a particular member is not only a Python problem, or an "only languages without explicit public/private/protected" problem. One reason why composition is favored -- and remember, "composition over inheritance" goes back to the GoF book and earlier! -- is clearing this up.

Of course, blindly "composing" is also bad, which is what this post points out.

Re:The Sororicide Antipattern by pseudalopex on Thursday June 01, 2017 @04:51PM (#14464572)
You're right that visibility modifiers don't solve the general problem, but the author specifically says "Inheritance is bad... because it leaves each layer nowhere to put its internal state".
Re:The Sororicide Antipattern by stinos on Thursday June 01, 2017 @03:44PM (#14463791)
This. I expected a whole bunch of arguments against it (not that I haven't read all of them before) but the It’s a bad way for two layers of a system to communicate because it leaves each layer nowhere to put its internal state that the other doesn’t need to know about. argument is indeed kinda weak given that exact problem is solved in other laguages, so can in my opinion not really be used to prove the more general statement 'inheritance is bad'.
Re:The Sororicide Antipattern by pseudalopex on Thursday June 01, 2017 @04:31PM (#14464311)
The author's argument is the Python equivalent of "protected isn't private". A.__note and B.__note wouldn't collide.