Click here to Skip to main content
15,880,796 members

The Insider News

   

The Insider News is for breaking IT and Software development news. Post your news, your alerts and your inside scoops. This is an IT news-only forum - all off-topic, non-news posts will be removed. If you wish to ask a programming question please post it here.

Get The Daily Insider direct to your mailbox every day. Subscribe now!

 
NewsIs inheritance dead? Pin
Kent Sharkey7-Dec-16 11:23
staffKent Sharkey7-Dec-16 11:23 
GeneralRe: Is inheritance dead? Pin
Jon McKee7-Dec-16 12:35
professionalJon McKee7-Dec-16 12:35 
GeneralRe: Is inheritance dead? Pin
TheGreatAndPowerfulOz8-Dec-16 9:53
TheGreatAndPowerfulOz8-Dec-16 9:53 
GeneralRe: Is inheritance dead? Pin
Jon McKee8-Dec-16 10:44
professionalJon McKee8-Dec-16 10:44 
GeneralRe: Is inheritance dead? Pin
TheGreatAndPowerfulOz8-Dec-16 12:37
TheGreatAndPowerfulOz8-Dec-16 12:37 
GeneralRe: Is inheritance dead? Pin
Rob Grainger8-Dec-16 22:24
Rob Grainger8-Dec-16 22:24 
GeneralRe: Is inheritance dead? Pin
Jon McKee9-Dec-16 2:57
professionalJon McKee9-Dec-16 2:57 
GeneralRe: Is inheritance dead? Pin
Rob Grainger11-Dec-16 13:12
Rob Grainger11-Dec-16 13:12 
I had to look up what Perl does with MI, but it was an approach I've seen elsewhere.

The issue with schemes like that is that you have to look at the implementation of a class, in particular its inheritance structure, to be able to be sure of the effect of a method call. That, to my mind, breaks encapsulation and the principle of least surprise.

What Eiffel does is effectively to disallow conflicts. If a conflict is detected, compilation fails (it is a statically-typed language). However, the renaming and remapping concepts provide the mechanisms required to resolve the conflict. In Eiffel, it is possible to generate a "flat" view of a class, that lists all available methods, without needing to refer to its hierarchy at all.

I also appreciate the mixin approach, but multiple inheritance does not prevent this - it is simple to define a mixin with MI, but the converse is not true. Similar to how prototype-based languages (notably Self - which, in its standard distribution, includes a complete Smalltalk-80 subsystem) can easily model classes, simply by having the class object be a prototype, while the converse is not true.

I'm a great fan of using the simplest model that allows full expressiveness, it is simple then to program in various idiomatic styles. Unnecessarily limiting expressiveness makes you jump through hoops, or become a language lawyer, to solve problems. The worst offenders I know of are C++ (where overload resolution mechanisms in the presence of templates are a dark art) and JavaScript, where some early mistakes in the language definition (understandable, given the time Douglas Crockford was given to create a language) still haunt us today.

Funny that the two could be regarded as being at different extremes of the various ways you can categorise languages (static-typing vs. dynamic typing, prototype-based vs. class-based, forgiving vs. strict with respect to syntax).

(I am a bit of a language nerd though, so maybe that colours my perspective too much).
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.

GeneralRe: Is inheritance dead? Pin
Jon McKee11-Dec-16 14:04
professionalJon McKee11-Dec-16 14:04 
GeneralRe: Is inheritance dead? Pin
PIEBALDconsult7-Dec-16 13:33
mvePIEBALDconsult7-Dec-16 13:33 
GeneralRe: Is inheritance dead? Pin
Nelek7-Dec-16 19:57
protectorNelek7-Dec-16 19:57 
GeneralRe: Is inheritance dead? Pin
TheGreatAndPowerfulOz8-Dec-16 9:51
TheGreatAndPowerfulOz8-Dec-16 9:51 
GeneralRe: Is inheritance dead? Pin
PIEBALDconsult8-Dec-16 12:55
mvePIEBALDconsult8-Dec-16 12:55 
GeneralRe: Is inheritance dead? Pin
TheGreatAndPowerfulOz8-Dec-16 13:00
TheGreatAndPowerfulOz8-Dec-16 13:00 
GeneralRe: Is inheritance dead? Pin
PIEBALDconsult8-Dec-16 15:33
mvePIEBALDconsult8-Dec-16 15:33 
GeneralRe: Is inheritance dead? Pin
TheGreatAndPowerfulOz8-Dec-16 16:46
TheGreatAndPowerfulOz8-Dec-16 16:46 
GeneralRe: Is inheritance dead? Pin
PIEBALDconsult9-Dec-16 2:32
mvePIEBALDconsult9-Dec-16 2:32 
GeneralRe: Is inheritance dead? Pin
TheGreatAndPowerfulOz9-Dec-16 5:56
TheGreatAndPowerfulOz9-Dec-16 5:56 
GeneralRe: Is inheritance dead? Pin
PIEBALDconsult9-Dec-16 6:45
mvePIEBALDconsult9-Dec-16 6:45 
GeneralRe: Is inheritance dead? Pin
TheGreatAndPowerfulOz9-Dec-16 6:50
TheGreatAndPowerfulOz9-Dec-16 6:50 
GeneralRe: Is inheritance dead? Pin
jsc427-Dec-16 21:45
professionaljsc427-Dec-16 21:45 
GeneralRe: Is inheritance dead? Pin
TheGreatAndPowerfulOz8-Dec-16 9:53
TheGreatAndPowerfulOz8-Dec-16 9:53 
GeneralRe: Is inheritance dead? Pin
Wastedtalent7-Dec-16 21:52
professionalWastedtalent7-Dec-16 21:52 
NewsHalf of people believe fake facts Pin
Kent Sharkey7-Dec-16 10:56
staffKent Sharkey7-Dec-16 10:56 
GeneralRe: Half of people believe fake facts Pin
PIEBALDconsult7-Dec-16 13:35
mvePIEBALDconsult7-Dec-16 13:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.