What is Ruby

Ruby is a general purpose, cross-platform scripting language that was introduced 1995 by Yukihiro Matsumoto (no, I can’t remember that name).

Ruby Logo

copyright © 2006, Yukihiro Matsumoto.

It was inspired by Perl, Smalltalk, Lisp and others. The heritage of Smalltalk gives some nice things:

  • Everything is an object. Of course, this sentense is kind of overused, but it is still nice to know that.
  • Code is an object too. This is cooler, eventhough “everything” should include code, it often does not. In Ruby, you can pass around blocks of code and execute them, whenever you like (and IF you like).

Ruby is very hands on. Don’t mind rules too much, break them, as you go along. Just make things easy to build, and don’t listen too much to folks talking about best practices. Well, there still are conventions, but do with the language, what you want. Sure, you could figure out, how ruby handles input from files, but you could write `cat /path/to/file` much faster.

Also ruby can be used as some kind of glue, as you might use a shell too. As you saw, executing other commands is really trivial, but using C modules seems to be easy as well.

Surely there are the standard features: Object Oriented Programing, Garbage Collection, Regular Expressions, facilities for Unit Tests, … but there is special interest material as well: for example dynamic expansion of objects. That is, you can define your own methods on Integers or only on the integer 1.

Another thing about Ruby is Rails, a platform for the web, so when you are about to create a webpage, you might consider Ruby instead of the mainstream PHP stuff. Of course there are others, but it’s always good to know many languages, when you get around.

  1. No comments yet.

  1. No trackbacks yet.