9 responses

  1. Cameron Laird
    October 9, 2012

    I’ll be blunt: I’m so fond of brevity that, at the moment, I prefer your comment, Mark Francis Jaeger, to the whole article I wrote. This is important stuff, important enough that on some days I think we should just confine ourselves to repeating slogans like “Favor composition over inheritance”. There’s little point in refinements like Liskov substitutability when we collectively don’t get the basics right. 
    That’s my way of thanking you, Mark Francis Jaeger. I agree: it is puzzling that textbook authors, among others, persist in the imbalances you describe when it’s so long past the time we should know better.

  2. Mark Francis Jaeger
    October 9, 2012

    It still amazes me how textbook authors get this wrong. Josh Bloch’s Effective Java taught us a long time ago to Favor composition over inheritance. Kent Beck’s Implementation Patterns decried the “pernicious use of inheritance” for “creating parallel hierarchies” and recommended delegation as a cure. still we see whole chapters on inheritance and only a small section on composition.

  3. Christian
    October 10, 2012

    I can confirm that inheritance is misused in many practical scenarios. Generic may be the solution in some cases, but there are many cases where excessive use of generics leads only to another flavor of bad code. 
    I think the main problem is that many languages don’t support an easy way of delegation. You need something like Scala traits, Ruby mixins or Go struct embedding to get the job done conveniently.

  4. Jaime Metcher
    October 11, 2012

    “One fundamental aspect of OO expressiveness is class definitions in terms of inheritance.” 
    No it’s not. 
    Seriously, though, what are you saying? OO is a “fashion acquisition”? Or composition is under-emphasised? The bombshells up front don’t help the quite reasonable statements you make later on. I too prefer Mark’s version, and indeed your response to it, over the main article. 

  5. Cameron Laird
    October 11, 2012

    If I understand, Jaime Metcher, you find me … uneven; I’m sending mixed signals. That’s probably so. I have a strong perception that the same message has to be carried in different words to reach different audiences. We all recognize that whatever I am saying, it’s not new. I have a hope, though, that this particular presentation will get through to a new cohort of readers. 
    I’m serious about the nature of programming as a species of fashion trade. I think it’s important for practitioners to be clear about which techniques are objectively superior, which are cultural conventions, which best practices, which transient fashions, and so on. I’ll be pleased if readers acquire a little skepticisim or reserve about the zealotry and salesmanship that determines so much of day-to-day development. 
    I summarize: I can well understand that the headlines and rhetoric near the front of the article “don’t help [you understand] the quite reasonable statements … later on”, but I’ve come to believe that they are essential for other readers. As Harlan Ellison used to preach (in my rough paraphrase), feel free to think of that stuff as a wrapper you’re free to discard at no extra charge. 
    The construction of the article actually ties in with another of my programming themes: my interest is not so much with intrinsic virtue–is OO a good thing? Is this article entirely consistent?–as it is with fitness for a purpose: how do we use OO in the best way for these particular requirements? Does this particular article reach this particular audience? 
    I try different treatments at different times, Jaime. The best way to thank you for your observations is to offer that perhaps something else I’ve written will serve you better. I’d love to chat with you more about your own work in … is “medical informatics” a fair label?

  6. Jaime Metcher
    October 12, 2012

    I have no beef with rhetoric but this rhetoric doesn’t do it for me. No matter, as you say someone else will grok it. And I’ll accept your invitation to browse your impressive list of publications. 
    I couldn’t help noticing that the hyperlink on “experiments”, which I was hoping would lead to some evidence about the efficacy of OOP, in fact leads to a philosophical discussion about whether such evidence is possible to get. Are you aware of any successful efforts to produce such evidence? 
    As for medical informatics – close but not quite, my field is professional education with some emphasis on online continuing medical education.

  7. jmarranz
    October 12, 2012
  8. Cameron Laird
    October 12, 2012

    YES, as it turns out, there is serious experimental evidence that bears on the effectiveness of different programming techniques. I’ll return by Monday with more details. 
    I don’t want the link you describe to be a “tease”; I’ll see what I can do about that. 
    Thanks for the real-world examples. I’m largely tied up today; I’ll need to follow up next week.

  9. Daniel Paull
    February 13, 2013

    Let us not confuse inheritance and dynamic polymorphism. Most developers see them as pretty much the same thing. In C++ we can use inheritance to implement class mixins – a wonderful technique when done properly. It’s probably a subset of policy based design as championed by Alexandrescu. 
    I wrote a post some time ago titled “C++ Mixins – Reuse through inheritance is good… when done the right way” that seem relevant. 

Leave a Reply




Back to top
mobile desktop