What is a dynamic language, and why doesn't C# qualify?

egyamado picture egyamado · Apr 24, 2009 · Viewed 30.9k times · Source

Listening to a podcast, I heard that C# is not dynamic language while Ruby is.

What is a "dynamic language"? Does the existence of dynamic languages imply that there are static languages?

Why is C# a dynamic language and what other languages are dynamic? If C# is not dynamic, why is Microsoft pushing it strongly to the market?

As well why most of .NET programmers are going crazy over it and leaving other languages and moving to C#?

Why is Ruby "the language of the future"?

Answer

JaredPar picture JaredPar · Apr 24, 2009

What is a dynamic language?

Whether or not a language is dynamic typically refers to the type of binding the compiler does: static or late binding.

Static binding simply means that the method (or method hierarchy for virtual methods) is bound at compile time. There may be a virtual dispatch involved at runtime but the method token is bound at compile time. If a suitable method does not exist at compile time you will receive an error.

Dynamic languages are the opposite. They do their work at runtime. They do little or no checking for the existence of methods at compile time but instead do it all at runtime.

Why is C# not a dynamic language?

C#, prior to 4.0, is a statically bound language and hence is not a dynamic language.

Why is Ruby the language of the future?

This question is based on a false premise, namely that there does exist one language that is the future of programming. There isn't such a language today because no single language is the best at doing all the different types of programming that need to be done.

For instance Ruby is a great language for a lot of different applications: web development is a popular one. I would not however write an operating system in it.