News for hackers. Stuff that matters.
Re:It is ridiculously easy to refactor Go by skrebbel on Sunday January 27, 2013 @10:14PM (#5126910)
I don't completely seee the point - in more established OO languages you'd make two one-line wrapper classes that both implement Get() and be done with it. Not stuck at all.. Extra indirection, yes, but is your performance going to block on parsing mime mails?
Re:It is ridiculously easy to refactor Go by Djehngo on Monday January 28, 2013 @05:21AM (#5127937)
I assumed you would do the same thing as was done in the article.

Create an interface and have a function that takes implementations of that interface as a parameter. The difference would be that in Java or C# you would need to explicitly mark Header and MIMEHeader as implementing emailHeader

I don't think much will come of discussing what is/isn't possible in a language given that they are all Turing complete. Usually posts like this are used for discussing what's easier or cleaner in a language.

For what it's worth I think having dynamic interfaces is cool, but I can only really think of one place I have actually relied on that capability.

Mostly the "dynamic"ness is nice for decoupling code. You can have a package(A) containing a function that takes an interface a parameter, a package(B) containing an implementation of the interface in A and a package (C) which passes the implementation in B to the function in A.

Given this situation C needs to import A and B but neither A nor B need to know about each-other.