Showing posts with label dynamic typing. Show all posts
Showing posts with label dynamic typing. Show all posts

Monday, March 12, 2012

Ruby vs. C#

I've been working with C# on the day job and Ruby on a side project. Shifting between the two has been enlightening.

C# is a statically typed language; Ruby is dynamically typed. I have come to rely on statically typed definitions, so I am a decent coder in C#.

I find that the coding experience in Ruby is quite different. I cannot rely on the IDE to tell me when I have assigned an improper value - in Ruby one can assign anything to any variable. It is easy to forget the type of variable and assign the wrong thing; I find out only at runtime, usually with an error of "undefined  method (methodname) for (classname)".

To get things right in Ruby, I must be more disciplined in my thoughts and in my programming. I'm not sure that this is a bad thing... I'm also not sure that this is a good thing. At the moment, I know only that it is a different way to program.