2
votes
3answers
178 views

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

In Object Oriented Programming, we're taught to think in terms of Polymorphism (the idea that the implementation is decoupled from the interface - and that it makes sense to think of the interface ...
2
votes
2answers
155 views

Java: method takes varargs of unrelated types

I have a Java factory method with a varargs array of Objects at the end. The array can contain any combination of Strings and ScaledJpegs. The theory being that an HTML table cell can contain any ...
5
votes
1answer
356 views

Why do generics in Scala have erased types, and are not reifiable?

Why do generics in Scala have erased types, and are not reifiable? Is it due to lack of support from the JVM or for compatibility with Java libraries? What are the advantages in general of having ...
11
votes
1answer
684 views

(Dis-)advantages of structural typing

I’ve just watched this talk by Daniel Spiewak where he talks about the advantages of structural typing as compared to Scala’s ans Java’s nominal typing. One example for this difference would be the ...