Talk:Inheritance (object-oriented programming)

This is an old revision of this page, as edited by Mintguy (talk | contribs) at 15:21, 6 June 2003. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

This is the best place for this article. Despite the attempts by OO enthusiasts to hijack the concept of inheritance as their exclusive property, it can be found in use in functional programming circles as well. -- Derek Ross 20:10 18 May 2003 (UTC)

But the article discusses oop inheritance! Mintguy 20:17 18 May 2003 (UTC)


Moved from Mintguy's talkpage

Please stop an attempt to limit usage of oo terms. Inheritance is used not only in OOP but in OO-design or other components model. What's wrong with the naming inheritance (computer science)? -- Taku 20:09 18 May 2003 (UTC)
The first sentence of that article is "In computer science's object-oriented programming theory, inheritance...". So what is wrong with the current title? All of the current articles about OO theory and design are at listed as object-oriented programming. Mintguy 20:15 18 May 2003 (UTC)
Looks to me like the first sentence should be changed then. Inheritance can be used in any language with functions. That makes it a concept with a much bigger applicability than just OO theory and design. It's part of re-usability. -- Derek Ross 20:23 18 May 2003 (UTC)
The article is ALL about inheritance in OOP which is one of the fundamental aspects of all OOP languages it needs an article of its own. Mintguy 20:27 18 May 2003 (UTC)
The article needs more work for sure. I just didn't have time to do that. But we first have to rename the article because if I started to add mention about inheritance other than that in OOP. People will complain the article is inheritance in OOP. You know this is egg and chiken problem. To solve the problem, first we need to rename the article then we can move to change the actual text. -- Taku 20:32 18 May 2003 (UTC)
Inheritance is an OO concept and not a procedural one. Now you could put the OO articles under OOD rather than OOP but I don't think it makes much difference as for the most part OOD is implemented with OOP and most of the articles about OO are under OOP. So why do you have a problem in putting Inheritance at OOP, it should either be under OOP or OOD and not computer Science. Mintguy 20:39 18 May 2003 (UTC)

Ok, how about this question. Why inheritance should be under OOP or OOD not simply computer science? what's wrong with the title inheritance (computer science) -- Taku 01:37 19 May 2003 (UTC)

Because Inheritance is a fundamental OO concept. It belongs with OOD or OOP. If you don't have objects in the first place how can you have inherited behaviour!? Mintguy 01:41 19 May 2003 (UTC)
Very easily. The inheritance process might occur at a deeper level, and then not be attached to anything that amounts to being an object after all. Think of colour: green may inherit from yellow and blue, but none of them is "real" until you have an object of that colour. This makes sense - mix yellow and blue paint before they go on an object, but then put the paint on some final object that will be green. Only along comes something else, a theory of colour vision say. Now you have green light, quite separately from any object in the original sense. Or concepts of "green" in politics that don't attach to light at all. Yes, I am "just playing" - but it's serious. I'm playing with concepts, not just with words. PML.
Ahhah... but blue doesn't inherit from green and yellow, it's a primary colour. So your theory get blown out of the water and I waltz off with a wry grin. Mintguy 01:58 19 May 2003 (UTC)
No, you just pushed the analogy beyond the limits of its value for the purposes of illustration - which was all it was there for and which I suspect you knew. Just as I suspect you took the point. PML.
Do you know some OOP language doesn't rely on inheritance at all but instead it uses delegation. Anyway, actually you didn't answer my question. what's wrong with the title inheritance (computer science)? My point is why OOP not computer science? Remember it really doesn't matter what is OOP since people have a different view about it. You think inheritance is a fundermantal OO concept while some don't. It is ok but we cannot impose our perception. Instead, we need to be more objective and nutral. In other words, it's really doesn't matter what is the truth here but what people believe the truth is. -- Taku 03:42 19 May 2003 (UTC)
The answer to your question is written clearly above but I'll repeat it - If you don't have objects in the first place how can you have inherited behaviour!? the concept of inheritance relies upon the concept of objects. The design needs objects even if the language doesn't posses them. You can mimic C++ objects in C. Whether your language has classes or not is irrelevant! Mintguy
First, please calm down. I don't mean to insult you or anything at all. We can just discuss about naming peacefully. No? My question is actually different than what you think. I am merely talking about why do you object naming inheritance (computer science). what's wrong with that? Do you think inheritance is NOT a computer science topic? Do you object the name inheritance (computer science) or do you think while it can be acceptable, inheritance (object-oriented programming) is better than it? -- Taku 00:12 20 May 2003 (UTC)
As to your point about inheritance vs delegation. It's the old "is-a" vs "has-a" argument there are reasons for choosing one above another depending on the design. Mintguy
I believe it is more like implementation issue than design. (but anyway this is rather off-topic)


Taku what the hell are you doing. I've already proved to you that Inheritance is a fundamental concept of OO.

Taku for goodness sake what is the matter with you?

And I thought I disproved by showing some OOP languages (called object-based languages) do not use inheritance. And you NEVER answered my question (see above). You keep the debate, otherwise you tell people you agree with the other side. -- Taku 01:39 23 May 2003 (UTC)
I agree with Taku, it's much better to have the article under (computer science). It doesn't necessarily have to do with programming (consider UML for example), and as Taku says, OOP languages do not necessarily use inheritance. It might be appropriate to put it under (Object-oriented design), but this kind of excludes programming, and computer science as a whole. We can talk about inheritance without talking about objects - like the green-blue-yellow example above, or maybe inherited properties, attributes, methods, functions, etc. (which are usually talking about an object, but may be talking about a static class or some other abstract concept as well.) Better to be safe and leave it under (computer science). -- Wapcaplet 01:44 23 May 2003 (UTC)

Wap.. read the damn article. It's about inheritance in OOD and OOP which is about inherited behavior. This is a fundamental concept of the OO paradim and doesn't exist outside of it. Mintguy 01:48 23 May 2003 (UTC)

Taku how many times do you have to be told. Object based languaged do NOT follow the object oriented paradigm, that is why they are called object based and NOT object-oriented and that is why object based languages do not have inheritance. Mintguy 01:51 23 May 2003 (UTC)
True they don't follow object-oriend paradigm, which is yours and that of the majority. But again it is called POV. Evidence. It's a whole chapter so I cannot quote that but the chapter says in its intro "[...] we discuss two other styles of languages that are often discussed as object-oriented languages: object-based and multi-method languages. [...] The goal is to highlight differences in languages that are grouped under the umbrella label of object-oriented languages." (From Foundations of Object-Oriented Languages Kim B. Bruce) Then the chapter discusses so-called object-based languages without inheritance. Absolutely you can claim object-based language is not OOP language but there are a few people who disagree with it. And such language is categorized as OOP languages if it is wrong, or you don't like it. We don't have to dispute which side is right. Sorry about dead-link. I cannot prove but it was alive when I posted it. -- Taku 02:37 23 May 2003 (UTC)
I've read some bad programming books in my time and this must be one of them. The guy is an idiot. There is such a clear distinction between object oriented and object based. Object oriented is a whole different way of thinking about programming, abstracting out from the implementation details by polymorphism through inheritance. It's not just grouping functions and data into objects for convenience and code re-use. Mintguy 02:46 23 May 2003 (UTC)
You might be right but it really doesn't matter because the whole point is some people who claim object-based languagesd are OOP exist. By the way if you doubt the credibility of this book, see http://www.amazon.com/exec/obidos/tg/detail/-/026202523X/qid=1053658373/sr=8-2/ref=sr_8_2/104-1500070-2293540?v=glance&s=books&n=507846. Of course we cannot count on guys in MIT are always right. -- Taku 02:53 23 May 2003 (UTC)

Er, yes, but the contents of the article can change. My point is that Inheritance need not necessarily be restricted to OOP or OOD. Hence I think it's better to use a (computer science) disambiguation in order to leave room for such growth in the future. Why are you so opposed to listing it under (computer science)? Do you think it is NOT computer science? -- Wapcaplet 01:52 23 May 2003 (UTC)

I don't understand your idea about inheritance outside of OO. The abstract blue green thing doesn't really cut it does it. How does that relate to programming. Of course OOP is computer science but it's a subset and all the other articles about object oriented features are listed under object-oriented programming. Mintguy 01:57 23 May 2003 (UTC)

I found this article which discusses ways of implementing encapsulation, inheritance, and polymorphism, without using OO. Sometimes these things are implemented in C, for example, which is not an OO language (and thus it's hard to imagine programming in it using OO concepts). -- Wapcaplet 02:07 23 May 2003 (UTC)
It discusses proposed extensions to a non-OO language to encompass OO design methods. So what is your point? It is not very hard (but awkward) to implement OO designs in non OO languages like C. I've said so myself on another talk page. However, this isn't true OO because you lose the encapsulation and you lose the abstraction because you don't have the ability to hide implementations that an OO language gives you. Mintguy 02:26 23 May 2003 (UTC)
As you say - "this isn't true OO." It's inheritance (polymorphism etc.) without object-oriented programming. -- Wapcaplet 02:29 23 May 2003 (UTC)
OO programming is the implementation of OO design. In this case in a non-OO language. In fact it is a valid argument to say that C++ (which is the most common OO language out there) isn't a true OO language itself because you can break the abstraction too easily. A better example of an OO language is Eiffel programming language but no bugger uses it. Mintguy 02:33 23 May 2003 (UTC)
Well, yeah. All I meant is that inheritance, while it is often part of object-oriented design and programming, need not necessarily be so. It's abstraction-oriented, but I don't see why it has to always be object-oriented. Just my POV, I may be wrong :) -- Wapcaplet 02:39 23 May 2003 (UTC)
What are you talking about when you say inheritance without objects? What is doing the inheriting and from what is it inheriting? If you are talking about extending datatypes, that's been around since the days of COBOL and has little to do with inheritance as we know it. Real inheritance involves capturing behavioural features of ... something... and passing it on to ...something.. else. Mintguy 02:54 23 May 2003 (UTC)
What is doing the inheriting and from what is it inheriting? Procedures can do the inheriting of behaviour from other procedures; functions from other functions. You can even implement inheritance in FORTRAN or LISP using this technique. -- Derek Ross 03:04 23 May 2003 (UTC)
That's not inheritance that's composition and delegation. That is calling a subroutine, by another name. Mintguy 03:23 23 May 2003 (UTC)
Modern versions of LISP (Common LISP Object System) adopt OO concepts of classes and inheritance. Fortran 90 has simple classes but it doesn't possess inheritance, it has to be mimicked. I believe a proposed object oriented version of FORTRAN is in development. Mintguy

This article is just fine where it is. Inheritence(computer science) redirects here, and the current article as it exists only talks about oop inheritence. If someone wants to make a broder article, in programming, do it. This doesn't need to be moved. Refer to oop. Look at the definition of oop. If you do create a inheritance (computer science) article, just put a link to this article where you talk about it's relation to oop. MB 17:48 4 Jun 2003 (UTC)


Ok, this has clearly been discussed to death, and I can't see any consensus arising. I'm putting it to a vote: whichever option has the most votes in a month's time (5th July) will be where I move the article. Martin 19:54 5 Jun 2003 (UTC)

This doesn't really cover inheritance as used in CSS etc., which are also part of computer science. BTW, Taku, did you mean to vote for that? -- John Owens 20:07 5 Jun 2003 (UTC)

I must admit I've played devil's advocate somewhat here. In the end I must say I'm in favor of (object-oriented programming). John makes a good point about CSS, which I hadn't considered, but then, that's not even part of Computer Science, really. Someday someone may write Inheritance (Cascading Style Sheets) but until then... -- Wapcaplet 01:55 6 Jun 2003 (UTC)

I still don't understand why we need a separate article about inheritance for OOP and other use in cs. Why not just have a inheritance (computer science) with a section regarding that especially in oop. I am afraid some day somebody simply merges two closely-related topics into just one article. -- Taku 03:39 6 Jun 2003 (UTC)

Besides, please stop objecting to renaming for the reason of the current content. We cannot put inheritance in fields other than that in OOP now because of its name. It is a egg and chicken problem to add more that conflicts with the current name, we first rename the article. -- Taku 03:49 6 Jun 2003 (UTC)

This is so absurd. This article exists. The inheritence article regarding all forms of inheritence (computer science) has yet to be created. Once it is created, it can link to this article. It would be too big if we included this huge article in it. We don't need to move this for someone to create Inheritance (computer science). For now, since the article doesn't exist, this is a good place to redirect it. Remember, this is an article about OOP inheritence, not all forms of CS inheritence. MB 04:20 6 Jun 2003 (UTC)

I am not sure what is absurd. You mean a voting list? We need to make sure where we can put inheritance in other than that in oop. The question is not moving or not but how to organize articles. -- Taku 04:32 6 Jun 2003 (UTC)

Also, I think we can talk inheritance in more general term if the article is named as inheritance (computer science). I think we still need to move this article if we have one article named inhertaicne (computer science) because if you read carefully, this article also has a general idea of inhertaince such as expansion, for instance. It is not limited to oop though the tone of the article is completely so. -- Taku 04:51 6 Jun 2003 (UTC)

The disambiguation tag is too specific. When I see Inheritance (object-oriented programming), I am expecting there to be a non-OOP inheritance page in programming, such as Inheritance (functional programming), which does not exist. Inheritance (computer science) is sufficient to disambiguate between inheritance in law and biology, and more specificity is unnecessary. In fact, the disambiguation page for Inheritance states "in computer science", which concedes that that is the field in which this term is apposite. SCCarlson 08:24 6 Jun 2003 (UTC)

You left a key part out. It says "In computer science, inheritance is a feature in object-oriented programming." MB 14:47 6 Jun 2003 (UTC)
It is the very fact that inheritance doesn't exist in these other paradigms, that makes Inheritance (object-oriented programming) a better title. Inheritance (genetics) would be a better title than Inheritance (biology) and Inheritance (tax) would be better than Inheritance (state funding). (Although these are all pretty ugly titles in themselves, i.e inheritance tax and genetics do the job perfectly well). Mintguy

Also John makes a good point about CSS. I must admit I hadn't thought about that myself. Inheritance (Cascading Style Sheets) would be correct for that should someone choose to wirte such an article outside of Cascading Style Sheet. It has little to do with programming and more to do with presentation and layout. It would be confusing it it was included with the rest of this article. But it is obviously part of computer science. Mintguy 15:21 6 Jun 2003 (UTC)