
Design
Explicit Structural Typing (Duck Typing)
I have always liked structural typing of interfaces (as found in Go and Scala), but I also like nominative typing of interfaces (as found in C# and Java). I kept switching back and forth between the two approaches when I realized that the middle ground was to provide a more powerful type coercion operator, by overloading the "as" operator.Related Reading
More Insights
INFO-LINK
![]() |
To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy. |