Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 94919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T23:34:37+00:00 2026-05-10T23:34:37+00:00

This is quite a controversial topic, and before you say no, is it really,

  • 0

This is quite a controversial topic, and before you say ‘no’, is it really, really needed?

I have been programming for about 10 years, and I can’t honestly say that I can recall a time where inheritance solved a problem that couldn’t be solved another way. On the other hand I can recall many times when I used inheritance, because I felt like I had to or because I though I was clever and ended up paying for it.

I can’t really see any circumstances where, from an implementation stand point, aggregation or another technique could not be used instead of inheritance.

My only caveat to this is that we would still allow inheritance of interfaces.

(Update)

Let’s give an example of why it’s needed instead of saying, ‘sometimes it’s just needed.’ That really isn’t helpful at all. Where is your proof?

(Update 2 Code Example)

Here’s the classic shape example, more powerful, and more explicit IMO, without inheritance. It is almost never the case in the real world that something really ‘Is a’ of something else. Almost always ‘Is Implemented in Terms of’ is more accurate.

public interface IShape {     void Draw(); }  public class BasicShape : IShape {     public void Draw()     {         // All shapes in this system have a dot in the middle except squares.         DrawDotInMiddle();     } }  public class Circle : IShape {     private BasicShape _basicShape;      public void Draw()     {         // Draw the circle part         DrawCircle();         _basicShape.Draw();     } }  public class Square : IShape {     private BasicShape _basicShape;      public void Draw()     {         // Draw the circle part         DrawSquare();     } } 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T23:34:37+00:00Added an answer on May 10, 2026 at 11:34 pm

    I blogged about this as a wacky idea a while ago.

    I don’t think it should be removed, but I think classes should be sealed by default to discourage inheritance when it’s not appropriate. It’s a powerful tool to have available, but it’s like a chain-saw – you really don’t want to use it unless it’s the perfect tool for the job. Otherwise you might start losing limbs.

    The are potential language features such as mix-ins which would make it easier to live without, IMO.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been reading on this quite some time...and i'm puzzled - Can you help
I have this quite long query that should give me some information about shipments,
I've been thinking about this quite a bit lately, and I would like some
Suppose you have to accomplish this quite generic task: Given a string, we'll say
I have been asked this question and have given this quite some thought but
I can't really find the exact information that solves this quite common problem. I
I have this quite popular problem, but have failed to find a solution that
This is quite the pickle... I have a regular HTML form with a couple
This is quite weird but my search function can search for any word except
This is quite a specific question, and I have had no luck on the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.