Ruby Nube

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.

On 15.06.2007 14:04, Bill M. wrote:

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?

Often scripting languages are dynamically typed, but there are others as
well. I guess Ruby is most widely used for everyday scripting tasks and
web development (Rails). I do believe there is a minority that uses it
successfully for bioinformatics.

  • What is the business proposition for using a dynamic language such as
    Ruby over Java / C#?

Um, I guess there is a ton of them. Strengths of Ruby are ease and
speed of development. So every use case where that is important might
be a candidate.

  • What kinds of things can be better with dynamic languages such as
    Ruby?

Development with Ruby tends to be faster. I am not sure though whether
that is related to the clean syntax and powerful functionality or to the
dynamic nature. It probably all plays a role…

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.

How about just trying it out? With many Linux distributions it’s just
one more package you have to install, on Windows there is cygwin and the
Windows installer version.

Kind regards

robert

On Jun 15, 2007, at 7:04 AM, Bill M. wrote:

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.

On 15.06.2007 18:30, John J. wrote:

  • What is the business proposition for using a dynamic language such as
    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

On 6/15/07, Bill M. [email protected] wrote:

  • What kinds of things can be better with dynamic languages such as
    Ruby?

Dynamic typing is based on the intuition that the language system itself
can
discover the types you intended to use. If you’re a dyed-in-the-wool
static-language programmer like me, this notion sounds nothing short of
insane at first. As it turns out, however, not only is it essentially
correct, but the errors you make under dynamic programming are not
usually
difficult to find.

Dynamic typing is one of those few things that seem like they must be
wrong,
but then surprise you by how right they are.

For the first two years after I learned Ruby, I wrote Ruby programs that
looked like uglier versions of C programs. Then the penny dropped. Now
my
only real problem with Ruby is its abysmal scalability to large data
sets.

On 15.06.2007 14:04, Bill M. wrote:

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?

Robert K. wrote:

Development with Ruby tends to be faster. I am not sure though whether
that is related to the clean syntax and powerful functionality or to
the
dynamic nature. It probably all plays a role…

Definitely faster. As Robert K. says, it all plays a role.

Even the fact that Ruby is an interpreted language vs. Java and C#
being compiled languages plays a role. In compiled languages your
development cycle goes:

Edit/Compile/Run/Repeat

while in interpreted languages it goes like this:

Edit/Run/Repeat

which tends to be faster, particularly in the early / exploratory
stages of development - it lets you try out more alternatives in the
same amount of time - so you have a better chance of coming up with a
better design or you can use this benefit to refactor your code more
to make it better (sooner).

To be fair, though, compiled (and therefore statically type-checked
languages) do have some advantages - certain kinds of errors tend to
be caught earlier, at compile time, particularly those due to using
incompatible types, method calls that don’t match the signature of the
method definition, etc. But its a bit of a moot point as to whether
either kind of language is better in absolute terms in this regard -
you’ll find plenty of opinions in both camps. (If you Google enough
you’ll get to read plenty of discussions on this …). Also the topic
is too big to be fully covered in a few posts …

Best thing to do is to try Ruby out and see if it works well for you.

Vasudev Ram