The Life‑Changing Magic of Ruby and Rails

Ruby is a Meritocracy

I recently read Russ Olsen's book Design Patterns in Ruby. In it, the author makes a wonderful distinction between statically vs. dynamically typed languages, which is different from all other comparisons I've seen.

Think of static typing as an aristocracy. In a statically typed language, an object's family tree matters.

Statically typed languages are constantly asking about your parent or grandparent. If you're programming in Java, they'll ask about your aunts and uncles (think interfaces).

Dynamically typed languages, by contrast, are meritocracies: They are concerned with which methods you have rather than where those methods came from.

Dynamically typed languages don't care about an object's ancestry; instead, they simply say, "I don't care who you are related to. All I want to know is what you can do."

If it looks like a duck and quacks like a duck, then it is a duck.

End of story.

Subscribe to Akshay's Blog

Sign up now to get access to the library of members-only issues.
Jamie Larson