Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options answers only not deleted user 1352

Polymorphism is about using objects of a type uniformly, regardless of their subtype.

11 votes
Accepted

How do you use duck typing in javascript without always checking for properties and methods?

I know javascript uses duck typing and at first I thought this would make polymorphism easy compared to strongly typed languages like C#. You are confusing multiple orthogonal axis of typing here. …
Jörg W Mittag's user avatar
9 votes

How to tackle extensibility considering the Data/Object Anti-Symmetry?

This has been termed the Expression Problem by Phil Wadler, although it is much older than the discussion in which he came up with this term. Solving it is one of the "holy grails" of Programming Lang …
Jörg W Mittag's user avatar
9 votes

What is polymorphism if you can already have methods that are the same defined in different ...

So circle1 and rectangle1 understood the same message draw() without using Polymorphism! What makes you think they are not using Polymorphism? Am I missing something? … Yes: that what you describe is Polymorphism, by definition. …
Jörg W Mittag's user avatar
6 votes

What is the process of determining which method in a class hierarchy should execute known as?

None of the above. There is no universal term, it depends on the language and the community, but the correct answer is one of message dispatch (virtual) method dispatch (virtual) method resolution …
Jörg W Mittag's user avatar
4 votes

What is the difference between Haskell's type classes and Go's interfaces?

They are completely different. Go interfaces define a protocol for values, Haskell type classes define a protocol for types. (That's why they are called "type classes", after all. They classify types, …
Jörg W Mittag's user avatar
3 votes
Accepted

Is 'design with types first' ultimately the same as 'design with interfaces first'?

In Java-like languages, interfaces describe object types, classes describe abstract data types. "Design with interfaces first" is not the same as "design with types first", simply because in a Java-li …
Jörg W Mittag's user avatar
3 votes

What is Polymorphism?

The most widely-used and most well-known type of polymorphism is probably parametric polymorphism (also sometimes known as generics). … This is by no means an exhaustive list, we haven't talked about inclusion polymorphism, subtype polymorphism, F-bounded polymorphism, or the various forms of ad-hoc polymorphism (for example, Haskell's …
Jörg W Mittag's user avatar