Introduction

image with no caption

As you are now reading a book on Ruby, I think it is safe to assume you don’t need me to persuade you of the merits of the Ruby language. Instead, I’ll take the somewhat unconventional step of starting with a warning: Many people are attracted to Ruby by its simple syntax and its ease of use. They are wrong. Ruby’s syntax may look simple at first sight, but the more you get to know the language, the more you will realize that it is, on the contrary, extremely complex. The plain fact of the matter is that Ruby has a number of pitfalls just waiting for unwary programmers to drop into.

In this book, it is my aim to guide you safely over the pitfalls and lead you through the choppy waters of Ruby’s syntax and class libraries. In the process, I’ll be exploring both the smooth, well-paved highways and the gnarlier, bumpy little byways of Ruby. By the end of the journey, you should be able to use Ruby safely and effectively without getting caught by unexpected hazards along the way.

The Book of Ruby describes versions 1.8.x and 1.9.x of the Ruby language. In most respects, Ruby 1.8 and 1.9 are very similar, and most programs written for one version will run unmodified in the other. There are important exceptions to this rule, however, and these are noted in the text. Ruby 1.9 may be regarded as a stepping stone toward Ruby 2.0. At the time of writing, a release date for Ruby 2.0 has not been announced. Even so, on the basis of currently available information, I anticipate that most (or all) of the information on Ruby 1.9 in this book should also apply to Ruby 2.0.

What Is Ruby?

Ruby is a cross-platform interpreted language that has many features in common with other “scripting” languages such as Perl and Python. It has an easily readable type of syntax that looks somewhat Pascal-like at first sight. It is thoroughly object-oriented and has a good deal in common with the great-granddaddy of “pure” object-oriented languages, Smalltalk. It has been said that the languages that most influenced the development of Ruby were Perl, Smalltalk, Eiffel, Ada, and Lisp. The Ruby language was created by Yukihiro Matsumoto (commonly known as Matz), and it was first released in 1995.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.89.2