On Mon, 13 May 2002, Steve Merrick wrote:

> Or even 'Why <insert scripting language of your choice>'? I know it's me
> that's ignorant. I'm hoping this forum can change that! ;-) Allowing for
> my background in C++/C/Assembler/Pascal/Fortran..., can you help me to
> understand what languages like Ruby are for?
> 
> Surely they're not just better versions of the 'language' used for
> writing MSDOS batch files? [No offence intended. ;-)] I know what to use
> C++ for, but I can't visualise a situation where I would look at the
> design problem and think 'No, not C++ - Ruby is what I should use here.'
> 
> I've tried to learn Ruby, and made some very basic progress, but I'm
> stuck in a mental rut. I can't think of what to use it for, so I can't
> see the point in learning any more about it. Help!! :-)
>
Probably the list of things not to use it for would be smaller, but
some advantages to using Ruby (several of which could also be said about
Python and Perl) would be:

  1. very high level language, with high level facilities for data
     representation.   This brings the problem description and the
     implementatiton much closer together, making the mental process
     of translation between the two planes much more clear and simple

  2. no compile -> link step.  This, along with #1 above is really great
     for prototyping and rapid application development.  You just make a
     change to your source, and execute it immediately:

        modify, run
        modify, run

     Its a very exhilirating feeling, and encourages one to experiment
     with alternate implementations to find the best one.

  3. Its ease of use, and the ease with which it can be modified make it
     and ideal choice for both graphic and non-graphic user interface
     modules.  Customers request modifications to the user interface
     logic more frequently and more urgently than in any other part of
     your application, because that is the part that they see and interact
     with.  You're going to be a big hit with your boss if you can make
     a user interface change in a day or less that would normally have
     taken 3-4 days to complete.  With Ruby, this is not a pipe dream.
     Its actually possible.

  4. Libraries provide accesss to external world things like datbases,
     web services, multimedia, etc.

  5. easy access to Tk interfaces faciitate writing portable GUI code.

  6. exceptions, rescue and ensure clauses can make error handling
     cleaner, and your code more robust.

  7. clear, simple, consistent language syntax, and aliases for method
     names, frees your mind to think about the problem rather than the
     details of how to correctly phrase a statement in the syntax of the
     chosen implementation language

If you have not yet read them, you also might find the following to be
better and more useful answers to your questions:

     37 Reasons I Love Ruby, by Hal Fulton:
     http://www.hypermetrics.com/ruby37.html

> --
> Steve Merrick
> 
> "Who cares, wins"
> 
>