CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 32
  1. #16
    Join Date
    Mar 2011
    Posts
    153

    Re: difference between polymorphism and overloading

    Quote Originally Posted by nuzzle View Post
    Well, you got the gist didn't you.

    C++ programmers usually have a quite limited outlook of what constitutes polymorphism. A broader view requires you to consider type systems and then there are four basic forms of polymorphism namely coersion, overloading, inclusion and parametric.

    With this information you can safely go on learning C++ enjoying the benefits of a very polymorphic type system. What's been said in this thread will become clear to you eventually. Good luck.
    Thank you for the luck!

    Regards
    H

  2. #17
    Join Date
    Mar 2001
    Posts
    2,529

    Re: difference between polymorphism and overloading

    Quote Originally Posted by nuzzle View Post
    C++ programmers usually have a quite limited outlook of what constitutes polymorphism.
    Must be having another senior moment.
    ahoodin
    To keep the plot moving, that's why.

  3. #18
    Join Date
    May 2009
    Posts
    2,413

    Re: difference between polymorphism and overloading

    Quote Originally Posted by ahoodin View Post
    Must be having another senior moment.
    Yes sometimes you forget that you never knew.

  4. #19
    Join Date
    Mar 2001
    Posts
    2,529

    Re: difference between polymorphism and overloading

    Nope it would be you. You are the Senior member who forgets how to behave and has the senior moments. And I mean plural, because you have had many of them over the past year. You think that you can just blurt anything out about C++ programmers. It is you who have the limited view of C++ programmers. You with the smart allec comments, and you who needs to learn manners.
    ahoodin
    To keep the plot moving, that's why.

  5. #20
    Join Date
    May 2009
    Posts
    2,413

    Re: difference between polymorphism and overloading

    Quote Originally Posted by ahoodin View Post
    Nope it would be you. You are the Senior member who forgets how to behave and has the senior moments. And I mean plural, because you have had many of them over the past year. You think that you can just blurt anything out about C++ programmers. It is you who have the limited view of C++ programmers. You with the smart allec comments, and you who needs to learn manners.
    Thank you for expanding my view on C++ programmers. Always well-mannered and never a senior moment right. Maybe I should ask one for a date. You don't happen to be ...

    But that won't change the facts. The predominant usage of the term polymorphism in the C++ community is limited compared with how it's used in the broader context of type systems.
    Last edited by nuzzle; October 24th, 2011 at 03:59 AM.

  6. #21
    Join Date
    Mar 2001
    Posts
    2,529

    Re: difference between polymorphism and overloading

    Are those really your professional ideas? Awesome, Wow!
    Simply Brilliant. Your nothing but a common Troll.
    Last edited by ahoodin; October 24th, 2011 at 07:25 AM.
    ahoodin
    To keep the plot moving, that's why.

  7. #22
    Join Date
    May 2009
    Posts
    2,413

    Re: difference between polymorphism and overloading

    Quote Originally Posted by ahoodin View Post
    Are those really your professional ideas? Awesome, Wow!
    Simply Brilliant. Your nothing but a common Troll.
    Mind your manners. Use arguments not defamating comments.

    It's not an idea, it's an observation. This is very typical,

    http://www.cplusplus.com/doc/tutorial/polymorphism/

    I quote,

    "One of the key features of derived classes is that a pointer to a derived class is type-compatible with a pointer to its base class. Polymorphism is the art of taking advantage of this simple but powerful and versatile feature, that brings Object Oriented Methodologies to its full potential."

    My emphasis. Sometimes also the mechanism of overloading is included in the concept of polymorphism and contrasted with the above and you get the "static vs. dynamic" distinction.

    Ask a C++ programmer about polymorphism and the above is the answer you're most likely to get. I'm not saying it's wrong or bad. But it's a limited view of what constitutes polymorphism.
    Last edited by nuzzle; October 24th, 2011 at 09:07 AM.

  8. #23
    Join Date
    Jun 2008
    Posts
    592

    Re: difference between polymorphism and overloading

    Quote Originally Posted by nuzzle
    Some go even further and consider polymorphism to be synonymous with the C++ virtual method dispatch mechanism
    This is because of the c++ standard. The only type of polymorphic behavior that goes by its direct effect is class polymorphism
    Quote Originally Posted by nuzzle
    but that won't change the facts. The predominant usage of the term polymorphism in the C++ community is limited compared with how it's used in the broader context of type systems.
    That is because c++ doesn't have another terminology for class polymorphism and therefore is typically referred to as polymorphism in general. I surely know how to use other types of polymorphism. The only thing I have to know is the c++ terminology when dealing with c++. So I go by c++ terminology like type casting since this is what the c++ standard goes by and not polymorphic coercion. So yes I know polymorphic coercion, inclusion polymorphism( aka subtype ), ad-hoc polymorphism, parametric polymorphism and whatever else is polymorphic in c++ by its terminology in c++.

    Quote Originally Posted by nuzzle
    I quote,

    "One of the key features of derived classes is that a pointer to a derived class is type-compatible with a pointer to its base class. Polymorphism is the art of taking advantage of this simple but powerful and versatile feature, that brings Object Oriented Methodologies to its full potential."
    ..................
    Ask the average C++ programmer about polymorphism and the above is the answer you get. I'm not saying it's wrong. But it's a limited view of what constitutes polymorphism.
    c++ is oop and that is what c++ mandates as polymorphism directly
    Quote Originally Posted by c++11 10.3
    Virtual functions support dynamic binding and object-oriented programming. A class that declares or
    inherits a virtual function is called a polymorphic class.
    So it does make since to use c++ terminology directly and not necessary how polymorphism applies to every part of the language in general.
    0100 0111 0110 1111 0110 0100 0010 0000 0110 1001 0111 0011 0010 0000 0110 0110 0110 1111 0111 0010
    0110 0101 0111 0110 0110 0101 0111 0010 0010 0001 0010 0001 0000 0000 0000 0000
    0000 0000 0000 0000

  9. #24
    Join Date
    May 2009
    Posts
    2,413

    Re: difference between polymorphism and overloading

    Quote Originally Posted by Joeman View Post
    So it does make since to use c++ terminology directly and not necessary how polymorphism applies to every part of the language in general.
    Sure. Other languages do the same.

    But the OP found it confusing and I thought he may benefit from the broader picture and not just the common C++ view only.

  10. #25
    Join Date
    Jan 2006
    Location
    Singapore
    Posts
    6,765

    Re: difference between polymorphism and overloading

    Quote Originally Posted by nuzzle
    It's not an idea, it's an observation.
    I observe that my post #12 and Lindley's post #13 did not get ahoodin so riled up, probably because I used "we (...) in C++", Lindley spoke about "C++", and we made objective statements about what is the norm with respect to C++, rather than use a phrase like "quite limited outlook" to contrast with "broader view" that can be intepreted as an aspersion on "C++ programmers" as a group from which you are trying to dissociate yourself. I doubt that these were your intentions, but phrased as such, I can see why ahoodin felt you were trolling.

    Quote Originally Posted by nuzzle
    I thought he may benefit from the broader picture and not just the common C++ view only.
    I agree.
    C + C++ Compiler: MinGW port of GCC
    Build + Version Control System: SCons + Bazaar

    Look up a C/C++ Reference and learn How To Ask Questions The Smart Way
    Kindly rate my posts if you found them useful

  11. #26
    Join Date
    Jan 2010
    Posts
    1,133

    Re: difference between polymorphism and overloading

    Quote Originally Posted by ahoodin View Post
    [directed @ nuzzle] You think that you can just blurt anything out about C++ programmers.
    Lol. From my experience, nuzzle has a habit of defending C++, funny that you now put him in the "other camp". XD

    Quote Originally Posted by ahoodin View Post
    Must be having another senior moment.
    Sure, we've all seen that nuzzle has his moments, but I think you're just overreacting to his comment - which wasn't particularly offensive, or ill-tempered. As far as I know nuzzle is a C++ programmer himself, at least among other things.

    It's good to have a more brother view of things, and specifically in this case, we all can agree that the idea of polymorphism is not something language-specific.
    Yes, you may never need to deal with it outside the context of C++, but it is important to make the distinction between what it fundamentally is, and how it manifests itself in the language mechanisms of C++. Then you can realize that it doesn't have to stop there, and that having this broader view will make you a better programmer, and it just might come in handy some day, when thinking out of the box is required.

  12. #27
    Join Date
    Jun 2008
    Posts
    592

    Re: difference between polymorphism and overloading

    I agree knowing how things work and why is important. That is why I like computers in the first place They are quite complicated.
    0100 0111 0110 1111 0110 0100 0010 0000 0110 1001 0111 0011 0010 0000 0110 0110 0110 1111 0111 0010
    0110 0101 0111 0110 0110 0101 0111 0010 0010 0001 0010 0001 0000 0000 0000 0000
    0000 0000 0000 0000

  13. #28
    Join Date
    May 2009
    Posts
    2,413

    Re: difference between polymorphism and overloading

    Quote Originally Posted by laserlight View Post
    I can see why ahoodin felt you were trolling.
    Sure, even in the most polite and correct C++ professional lurks a hooligan ready to strike out on the slightest hint his subculture is attacked.

    Help, I did it again didn't I

  14. #29
    Join Date
    Jan 2006
    Location
    Singapore
    Posts
    6,765

    Re: difference between polymorphism and overloading

    Quote Originally Posted by nuzzle
    Help, I did it again didn't I
    Don't blame me if ahoodin zaps you with a laser, or more likely polymorphs you into a sheep
    C + C++ Compiler: MinGW port of GCC
    Build + Version Control System: SCons + Bazaar

    Look up a C/C++ Reference and learn How To Ask Questions The Smart Way
    Kindly rate my posts if you found them useful

  15. #30
    Join Date
    Mar 2001
    Posts
    2,529

    Re: difference between polymorphism and overloading

    Quote Originally Posted by nuzzle View Post
    Sure, even in the most polite and correct C++ professional lurks a hooligan ready to strike out on the slightest hint his subculture is attacked.

    Help, I did it again didn't I
    That was senior moment 1736. You might want to keep your day job because standup just isn't your thing.
    ahoodin
    To keep the plot moving, that's why.

Page 2 of 3 FirstFirst 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured