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

Ask A Question

Stats

  • Questions 75k
  • Answers 75k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Yes, you can assign the IP to the pending instance.… May 11, 2026 at 2:52 pm
  • added an answer Setting up a web service or page method to add… May 11, 2026 at 2:52 pm
  • added an answer Have you checked out timedeltas? from datetime import datetime, timedelta… May 11, 2026 at 2:52 pm

Related Questions

I've never learnt JavaScript, but I imagine this is quite a simple problem. Just
This question is motivated by something I've lately started to see a bit too
I work on a large Intranet system - as it is an evolved system
I recently upgraded a c# windows service to run as a 64 bit .net

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.