From: Robert Klemme Date: 2007-06-16T02:05:07+09:00 Subject: Re: Ruby Nube On 15.06.2007 18:30, John Joyce wrote: > > On Jun 15, 2007, at 7:04 AM, Bill Man wrote: > >> Hello, >> >> The concept of Dynamically Typed Languages has peaked my interest. >> However, I have spent sometime trying to find what problem they exactly >> solve. Can anyone tell me: >> >> - What problems do dynamically typed languages such as Ruby solve? >> - What is the business proposition for using a dynamic language such as >> Ruby over Java / C#? >> - What kinds of things can be better with dynamic languages such as >> Ruby? >> >> Thank you so much for your help. I have been searching the web for a >> while and I haven't been able to find anything. >> >> -- >> Posted via http://www.ruby-forum.com/. >> > Dynamic typing itself is not such a big deal, but it does mean less > keyboarding, more concise code that is generally more readable. > Dynamic typing allows more duck typing and introspection. > You can try to send a message to an object. If it can do it, it will try. > But you can actually ask the object if it can do something before doing it. > Objective-C can also do this because it's got a bit of a runtime > But also, you get (sometimes arbitrary) language rules that can be useful. > In practice, it just makes some things more convenient with automagic > type conversions. > puts 5 > will actually convert the Fixnum 5 to a string for you. While I agree to the rest I would not attribute this example to dynamic typing. The same is possible (and is actually used) in Java because there (similarly to Ruby) toString() is a method of Object (the root class of the class hierarchy). Kind regards robert