Playing strong with Ruby

Rafael Miceli
A .Net Developer Mining Ruby
2 min readApr 28, 2015

So, is ruby strongly or weakly typed?

First let’s see what is the difference from a weakly to a strongly typed language? Wait, before I begin, let me clarify that this is a topic for a lot of discussions, so I will answer my point of view in the subject. If you want to discuss about this, please state your opinion in the comments, or better yet, blog trying me =].

Strongly typed

Normally a strongly typed language means that the language have a type discipline that is enforced by the compiler, for example C# which is considered a strongly typed language don’t let you declare an int variable and in the next line you try to do a mathematical operation adding a string you’ll see an error at compile time.

Weakly typed

Weakly type is the other way around, as the compiler doesn’t enforce a typing discipline, one example is in javascript, if you do the same as said for the strongly typed language you’ll get no compile error, nor when executing it!

Where’s ruby?

For most Rubyists, Ruby is considered the *strongest* dynamic language. Why this?

Let’s see why Ruby is the strongest

If you write my_variable = “hi ruby world”

And after try to do some mathematical operation like

my_variable + 2

We will get an error. “TypeErro: no implicit conversion of Fixnum into String

To compare with a weakly typed language, let’s do the same with JavaScript.

my_variable = “hi JavaScript world”;

my_variable + 2;

We will get: “hi JavaScript world2

Thank’s JavaScript xD

In the next let’s get serious and begin by Installing the tools we previously mentioned!

--

--