Tag Archives: duct tape

Duct Typing

Today people were tweeting up an old interview with Al3x Payne and some devs from Twitter about using Scala.

Al3x or anyone else has the right to use for whatever programming language they want. No questions asked…

But today I was reflecting on Al3x’s rationalization of the type system motivating a move to Scala. I mean we’ve heard this before and the whole thing got a lot of Ruby panties in a bundle when it first came out.

But checking for nil and kind_of? all over the place is not Ruby’s failing… that’s a big ball of mud in any language and I’ve seen people resort to the (null != foo) && (foo instanceof Bar)) anti-patterns in Java.

Al3x asserts this is an inherent property of large systems in dynamic languages. I’ll assert it is a property of systems that have grown organically to the point where the programmers can’t reason about what is coming or going. I’ll further argue that you get more out of thinking functionally towards solving this issue than you do from stricter typing.

If you find yourself constantly checking for nil/null or really being concerned with types except around the edges of a system, that’s a code smell IMHO.

But maybe another layer of duct tape will fix it…

totally duct'd

totally duct'd


%d bloggers like this: