What makes Ruby a dynamic language?

I am reading from time to time in several books that Ruby is a dynamic
language. I come from a .NET background where C# is considered a static
language.

What makes Ruby dynamic and what are those features?

Have you tried google? If not, why not?

Type something like “what is a dynamic language” and see what you get.
The ability to find answers to your own problems before you have to
ask someone else is a good trait for a programmer.

On 2012-09-01, at 14:07, Rubyist R. [email protected] wrote:

What makes Ruby dynamic and what are those features?

The most important feature making Ruby a dynamic language is that you
can alter classes at runtime. In C#, Java, and C++, you compile your
classes and they cannot be changed after compile time. In Ruby and
other dynamic languages, you can create and alter your classes while the
program is running.

2012/9/1 Uwe K. [email protected]


Uwe K.
http://ruboto.org/

There is dynamic programming in Java through reflection and proxies but it
isn’t nearly powerful like in Ruby.

Hi,

There is a nice article on wikipedia that will give you a quick glance
into
the subject Dynamic programming language - Wikipedia

Personally, I would name Eval, Object runtime alteration, and Reflection
as
the most important features, though there are much more opinions
(sometimes
very contradictive :wink: regarding this matter.

You guys aren’t really answering the person’s question.

On Sat, Sep 1, 2012 at 7:31 PM, Иван Бишевац [email protected]
wrote:

There is dynamic programming in Java through reflection and proxies but it
isn’t nearly powerful like in Ruby.

Careful with the wording: “dynamic programming” is a specific
algorithmic technique and has nothing to do in particular with why
Ruby is called a “dynamic language”.

An important point which apparently hasn’t been mentioned yet is
dynamic typing vs. static typing: in Ruby variables are typeless while
in statically typed languages they are typed.

Kind regards

robert

On Mon, Sep 3, 2012 at 4:32 AM, Robert K.
[email protected]wrote:

An important point which apparently hasn’t been mentioned yet is
dynamic typing vs. static typing: in Ruby variables are typeless while
in statically typed languages they are typed.

Type system - Wikipedia

Bingo. In statically typed languages, the compiler knows all types at
compile time. In dynamically typed (“untyped”) languages, in many cases
it’s not possible to know all types at compile time because they haven’t
all been declared.