Content deleted Content added
Tom.Reding (talk | contribs) m -redundant class param; cleanup |
|||
(21 intermediate revisions by 15 users not shown) | |||
Line 1:
{{WikiProject
{{WikiProject Computer science}}
{{WikiProject Java|importance=low}}
}}
{{To do}}
==Untitled==
Line 47 ⟶ 50:
[[Special:Contributions/90.211.234.107|90.211.234.107]] ([[User talk:90.211.234.107|talk]]) 10:08, 19 May 2008 (UTC)
== Delphi Section ==
I have no idea what DEEP is, in relation to either Delphi or Object Pascal. Neither does Wikipedia nor Google. I'm removing it. I'm adding in it's place, a reference to FPC and Object Pascal and linking all three to their respective articles. Perhaps somebody with time on their hands can do likewise with the other languages. --[[User:Ian_Macintosh|Ian Macintosh]] ([[User talk:Ian_Macintosh|talk]]) 19:49 25 July 2011 (UTC)
== syntax of the examples ==
Not strictly syntax, but some examples of the dog said "Arf! Arf!" and some said "Woof! Woof!". I'm changing them all to "Woof! Woof!" for consistency. Further, there is some other inconsistency with examples, some using Cat, Dog and others using Missy, Mr. Mistoffelees and Lassie. I'm thinking that Cat, Dog are more acceptable and require less knowledge of some specific English television programs and operas. Again, somebody with some time on hand might want to polish the other code examples, where appropriate, into the Cat, Dog example format --[[User:Ian_Macintosh|Ian Macintosh]] ([[User talk:Ian_Macintosh|talk]]) 19:49 25 July 2011 (UTC)
'''JAVA language example''':<br />
Line 97 ⟶ 106:
Hi, just writing a short note why I removed this section (I forgot to log in, but it was me :)), I think the section would probably make an interesting blog post, but it is not suitable for this article. It does not describe polymorphism, it describes something that uses it to achieve a very specific unrelated goal. Nor does it help the reader to better understand polymorphism. If you would insist on keeping it on Wikipedia, it would be less out of place in an article about circular dependency references. Additionally, it provided very little introduction, dropping the reader right into a technical detail of a very a different subject. [[User:Grauw|Grauw]] ([[User talk:Grauw|talk]]) 00:19, 13 January 2010 (UTC)
== Polymorphism is not exactly what this article claims it is ==
OK, "totally wrong" as I said in the edit change log is too strong. However, it's common to use "polymorphism" to refer to what's called [[function overloading]] here in Wikipedia, i.e. the ability to have different versions of the same-named function that take different numbers and/or types of arguments. The article here specifically claims that polymorphism is ''not'' function overloading, which is simply wrong. Take a look at many sources, e.g. www.programmersheaven.com/2/FAQ-JAVA-What-Is-Polymorphism (which I can't directly insert a link to) and [http://home.cogeco.ca/~ve3ll/jatutor5.htm], which refer to function overloading as one type of polymorphism. The second refers to the sort of polymorphism as discussed in this article as "dynamic binding polymorphism". See also this classic paper which describes the theoretical background of polymorphism: [http://lucacardelli.name/Papers/OnUnderstanding.A4.pdf]. This paper uses the term "parametric polymorphism" to refer to polymorphism of the function-overloading type. [[User:Benwing|Benwing]] ([[User talk:Benwing|talk]]) 23:55, 12 October 2010 (UTC)
Remember that this is an article specifically about Subtype Polymorphism, and it's true to say that Subtype Polymorphism is not the same as function overloading/overriding on their own (i.e. there needs to be derivation, or an interface). That said, I do feel this article is badly structured and misleading. The references you have provided explain the topic much more clearly.
([[User talk:80.47.152.131|talk]]) 08:59, 23 October 2010 (UTC)
== Trying to understand the first sentence of the article. ==
After further thinking, I removed my Perl (counter) example and comments, because I have even more basic questions, and, in retrospect, my example was not quite right.
Here is the first sentence of the article:
''Subtype polymorphism, almost universally called just polymorphism in the context of object-oriented programming, is the ability to create a variable, a function, or an object that has more than one form.
''
I think the sentence is unclear about who creates the variable, function or object.
After some thinking I believe the sentence want to say that it is the programmer whose ability we are talking about. So maybe, the sentence should be changed to (for clarity):
''Subtype polymorphism, almost universally called just polymorphism in the context of object-oriented programming, is the ability of the programmer to create a variable, a function, or an object that has more than one form.
''
Still, I do not really like this sentence.
What does it mean to create a variable that has more than one form?
What is the form of a variable? Same problem with a function.
Does creating a function means writing a function? How can one function have multiple forms? A function identifier might refer to multiple functions in different contexts. I understand this.
For an object, does creating it means instantiating it? Or is it the act of writing the code for the class that the object belongs to?
Now, if we mean the act of instantiation: What does it mean that the object created can have multiple ''forms''?
What does it mean for the object to have a single form? What is a form? Type?
I could go on.. But it would be nice if someone would clarify these things before I go any further (I feel that I am already speculating too much about the intention of the author). In summary, a little more precision would help.
[[User:Szepi|Szepi]] ([[User talk:Szepi|talk]]) 04:49, 5 February 2011 (UTC)
==Bad article... Bad article!==
This is a classic example of a lousy encyclopedia article. It's written in a stiff academic style that even [[Lilith Sternin]] would disapprove of. Worse, the author has no idea of how to organize and present the material to make it accessible and interesting. "Accessible and interesting" ''does not'' equate to "simplistic" or "inaccurate". One of the marks of a good writer is the ability to present complex material ''without'' watering it down (''qv'', [[Richard Feynman]]).
In short... it's BOR...ing. I quit after the first two paragraphs. It needs not only a complete rewrite, but a complete re-conceptualization. [[User:WilliamSommerwerck|WilliamSommerwerck]] ([[User talk:WilliamSommerwerck|talk]]) 19:40, 2 September 2011 (UTC)
== Cut down examples ==
Restored the examples, but then removed all but two. The ones I've chosen are C++ and Java, purely because this will cover a wide range of users, JavaScript is not OO and therefore is not a suitable example for this article, and Java/C/C# users should all be able to interpret the Java example quite easily. [[User:Carl Sixsmith|Carl Sixsmith]] ([[User talk:Carl Sixsmith|talk]]) 07:58, 26 October 2011 (UTC)
:I actually chose javascript because it ''wasn't'' OO, that way we had one example of polymorphism in an object context, and one in a function context. Why do we need two OO examples? The other benefit of the javascript example is that it's very simple. This is also true of the PHP and Python examples, which show the concept succinctly without getting bogged down in language-specific features and keywords that may not be accessible to a global audience. For instance, the java example (which is one of the best of the bunch), necessarily uses generics, annotations, and package imports inline between classes, without making it clear that they each need to be broken into separate files (why is that distinction important here anyway). I understand those concepts because I program in Java, but others may not. The C++ example has even more jargon. While that problem isn't "the end of the world", so to speak, it isn't a problem shared by other language examples we have readily available. What we need is a clear example in psuedocode (or as close to it as we can get), which is accessible to everyone from every background, with as few features as possible, which only serves to clearly highlight polymorphism, and nothing else. I don't believe the Java and C++ examples do that as well as others we could have chosen. — [[User:Mann_jess|<b>Jess</b>]]<span style="margin:0 7px;font-variant:small-caps;font-size:0.9em">· [[Special:Contributions/Mann_jess|Δ]][[User_talk:Mann_jess|♥]]</span> 16:43, 26 October 2011 (UTC)
:: The article is titled ''Polymorphism in object-oriented programming'' not polymorphism in general, that was my thinking behind leaving two OO examples. I'm not precious on the choice of languages though and agree the examples should be as simple as possible. According to http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html Java is still the number 1 popular programming language, that was the reasoning behind leaving that one in. Personally I'm a .net developer so would prefer a simple example in C#, but I went for the populist approach. I'm not too concerned with which gets chosen though. [[User:Carl Sixsmith|Carl Sixsmith]] ([[User talk:Carl Sixsmith|talk]]) 18:42, 26 October 2011 (UTC)
:::You're correct about the scope of the article being OO. Throughout the article, we refer to "polymorphism" generally, so the additional specificity in the article title sort of slipped my mind. That would, indeed, make the javascript example not relevant. After simplifying the java example a little bit, and changing C++ to Python, I'm actually ''okay'' with it. I still think the java example is really long, but PHP is too close to Python to make a second example of it useful, and the others I'm not so sure about. I think the current state of things is okay, assuming you're also fine with it. I'll assume you are based on your above response, but let me know if you have any other concerns. — [[User:Mann_jess|<b>Jess</b>]]<span style="margin:0 7px;font-variant:small-caps;font-size:0.9em">· [[Special:Contributions/Mann_jess|Δ]][[User_talk:Mann_jess|♥]]</span> 20:45, 26 October 2011 (UTC)
:::: Looks OK to me, I think within programming readers Java is better as it has a higher following, none programmers would probably be better served with a simpler C# example, but how many non-programmers are going to be interested in this article? I'm going to see if I can't add some references/clean up the rest of the article now. [[User:Carl Sixsmith|Carl Sixsmith]] ([[User talk:Carl Sixsmith|talk]]) 06:38, 27 October 2011 (UTC)
== Didn't Understand ==
This article doesn't tell what Polymorphism is. I read the article for four times. It fails to define Polymorphism. It fails to explain Polymorphism. It fails to distinguish it from function overloading.
Please -someone knowledgable- write a definition at the beginning and an explanation in the second paragraph. Then indicate the difference from overloading.--[[Special:Contributions/129.7.147.112|129.7.147.112]] ([[User talk:129.7.147.112|talk]]) 16:03, 15 December 2011 (UTC)
== Needs Merging ==
Since this article is so small and deals with a subdivion of the original concept, i feel it should be merged with the main article for polymorphism. In doing so it would shed light on the inaccuracies people have been complaining about and thus increase the chance of someone fixing the mistakes, there is no need for a separate article to discuss something that only needs a brief explanation to distinguish its use in OO vs other paradigms. <small><span class="autosigned">— Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[User:Konnerjr|Konnerjr]] ([[User talk:Konnerjr|talk]] • [[Special:Contributions/Konnerjr|contribs]]) 16:58, 21 December 2012 (UTC)</span></small><!-- Template:Unsigned --> <!--Autosigned by SineBot-->
== Python example doesn't show distinction between polymorphism and method overriding ==
The article clearly states that polymorphism is not method overriding. Yet isn't the latter exactly what the example is doing?
--[[User:Henre|Henre]] ([[User talk:Henre|talk]]) 23:33, 31 March 2013 (UTC)
:This article clearly states very little! We have:
::... ''Polymorphism (which is strictly referring to subtype polymorphism in the context of this article)'' ...
:Followed by a section headed:
::''Parametric Polymorphism''
:If you come to the areticle with no prior knowledge, you would leave confused. --[[User:Paddy3118|Paddy]] ([[User talk:Paddy3118|talk]]) 05:49, 21 April 2013 (UTC)
|