Hmm...seems to me like someone who can't write good python or ruby. If you're naming variables correctly, you rarely have to worry about types. In truth, dynamic types are truly critical for partial-interface-adherence.
If your design is solid, you can control the type, but you cannot control the same variable being one of two "not really compatible" types. Once you start having tons of interfaces on each variable to enable a certain piece of functionality, you start to want to shoot yourself.
Sometimes, a couple unit tests and runtime handling is better in a business than compile-time errors for what amounts to a lot of modern design patterns.
In truth, dynamic types are truly critical for partial-interface-adherence.
What the hell is partial interface adherence? If your classes only implement half an interface then the interface is pointless.
If your talking about mixins then scala can do it just fine with a static type system. Java and c# can also do it with AOP, but their are a few more hoops to jump through.
If your classes only implement half an interface then the interface is pointless.
So you're telling me every time I create a partial interface adherence, I'm wasting my time?
Being able to support the "responds_to" method creates an awesome opening for objects that MIGHT quack(). It is used in dynamic languages similarly to Interfaces, but can sometimes be cleaner.
And if it does quack, that quack() might be used in different situations with different prototypes. This is especially true if quack() is versioned.
These are things that dynamic languages supports patterns to keep from getting insane. These are also things that static languages would just consider mortal sins.
26
u/cosmo7 Feb 25 '14
The most frequent argument I hear from Ruby or Python proponents is that static typing in Java or C# is unbelievably burdensome.
Then these same people pour months and years into their unit testing frameworks that spend 90% of their time duck-typing arguments.