Sophie

Sophie

distrib > CentOS > 5 > x86_64 > by-pkgid > 6d36cb72372cfb7c8fee63f4d6dc0530 > files > 48

ruby-docs-1.8.5-31.el5_9.x86_64.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Preface</TITLE>
</HEAD>
<BODY text="#000000" bgcolor="#FFFFFF">
<A HREF="options.html">next</A>
-
<A HREF="index.html">index</A>
<HR>

<H1>Preface</H1>

<p>
Ruby is the interpreted scripting language for quick and
easy object-oriented programming.  It has many features to
process text files and to do system management tasks (as in
Perl).  It is simple, straight-forward, and extensible.
</p>
<p>
If you want a language for easy object-oriented programming,
or you don't like the PERL ugliness, or you do like the
concept of lisp, but don't like too much parentheses, Ruby
may be the language of the choice.
</p>
<p>
Ruby's features are as follows:
</p>
<blockquote>
<dl>
  <dt> <h4>Interpretive</h4>
  <dd> Ruby is the interpreted language, so you don't have
       to recompile to execute the program written in Ruby.
  <dt> <h4>Variables have no type (dynamic typing)</h4>
  <dd> Variables in Ruby can contain data of any type.  You
       don't have to worry about variable typing.  Consequently,
       it has weaker compile time check.
  <dt> <h4>No declaration needed</h4>
  <dd> You can use variables in your Ruby programs without
       any declarations.  Variable name itself denotes its
       scope (local, global, instance, etc.)
  <dt> <h4>Simple syntax</h4>
  <dd> Ruby has simple syntax influenced slightly from Eiffel.
  <dt> <h4>No user-level memory management</h4>
  <dd> Ruby has automatic memory management.  Objects no
       longer referenced from anywhere are automatically collected by the
       garbage collector built in the interpreter.
  <dt> <h4>Everything is object</h4>
  <dd> Ruby is the pure object-oriented language from the
       beginning.  Even basic data like integers are
       treated uniformly as objects.
  <dt> <h4>Class, inheritance, methods</h4>
  <dd> Of course, as a O-O language, Ruby has basic features
       like classes, inheritance, methods, etc.
  <dt> <h4>Singleton methods</h4>
  <dd> Ruby has the feature to define methods for certain
       specified object.  For example, you can define a
       press-button action for certain GUI button by
       defining a singleton method for the button.  Or, you
       can make up your own prototype based object system
       using singleton methods (if you want to).
  <dt> <h4>Mix-in by modules</h4>
  <dd> Ruby does not have the multiple inheritance
       intentionally.  IMO, It is the source of
       confusion. Instead, Ruby has modules to share the
       implementation across the inheritance tree. It is
       often called the "Mix-in." 
  <dt> <h4>Iterators</h4>
  <dd> Ruby has iterators for loop abstraction.
  <dt> <h4>Closures</h4>
  <dd> In Ruby, you can objectify the procedure.
  <dt> <h4>Text processing and regular expression</h4>
  <dd> Ruby has bunch of text processing features like in Perl.
  <dt> <h4>Bignums</h4>
  <dd> With built-in bignums, you can calculate
       factorial(400), for example.
  <dt> <h4>Exception handling</h4>
  <dd> As in Java(tm).
  <dt> <h4>Direct access to OS</h4>
  <dd> Ruby can call most of system calls on UNIX boxes.  It 
       can be used in system programming.
  <dt> <h4>Dynamic loading</h4>
  <dd> You can load object files into Ruby interpreter
       on-the-fly, on most of UNIXes.
</dl>
</blockquote>
<hr>
<A HREF="options.html">next</A>
-
<A HREF="index.html">index</A>
<P ALIGN=right><A HREF="mailto:matz@netlab.co.jp">matz@netlab.co.jp</A></P>
</BODY>
</HTML>