Talk:Polymorphism in object-oriented programming: Difference between revisions

Content deleted Content added
Line 103:
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)