Skip to content

Ruby Programming

August 6, 2009
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. It is simple, straight-forward, extensible, and portable.
It is totally free, which means not only free of charge, but also freedom to use, copy, modify, and distribute it.
Features of Ruby
1. Ruby has simple syntax, partially inspired by Eiffel and Ada.

2. Ruby has exception handling features, like Java or Python, to make it easy to handle errors.
3. Ruby is a complete, full, pure object oriented language: OOL. This means all data in Ruby is an object, in the sense of Smalltalk: no exceptions. Example: In Ruby, the number 1 is an instance of class Fixnum.
4. Ruby’s OO is carefully designed to be both complete and open for improvements. Example: Ruby has the ability to add methods to a class, or even to an instance during runtime. So, if needed, an instance of one class can behave differently from other instances of the same class.
5. Ruby features single inheritance only, on purpose. But Ruby knows the concept of modules. Modules are collections of methods. Every class can import a module and so gets all its methods for free. Some of us think that this is a much clearer way than multiple inheritance, which is complex, and not used very often compared with single inheritance (don’t count C++ here, as it has often no other choice due to strong type checking.
6. Ruby features blocks in its syntax (code surrounded by ‘{‘ … ‘}’ or ‘do’ … ‘end’). These blocks can be passed to methods, or converted into closures.
7. Ruby features a true mark-and-sweep garbage collector. It works with all Ruby objects. You don’t have to care about maintaining reference counts in extension libraries.
8. Writing C extensions in Ruby is easier than in Perl or Python, due partly to the garbage collector, and partly to the fine extension API. SWIG interface is also available.
9. Integers in Ruby can (and should) be used without counting their internal representation. There are small integers (instances of class Fixnum) and large integers (Bignum), but you need not worry over which one is used currently. If a value is small enough, an integer is a Fixnum, otherwise it is a Bignum. Conversion occurs automatically.
10. Ruby needs no variable declarations. It uses simple naming conventions to denote the scope of variables. Examples: simple ‘var’ = local variable, ‘@var’ = instance variable, ‘$var’ = global variable. So it is also not necessary to use a tiresome ‘self.’ prepended to every instance member.
11.Ruby can load extension libraries dynamically if an OS allows.
12. Ruby features OS independent threading. Thus, for all platforms on which Ruby runs, you also have multithreading, regardless of if the OS supports it or not, even on MS-DOS.
13. Ruby is highly portable: it is developed mostly on Linux, but works on many types of UNIX, DOS, Windows 95/98/Me/NT/2000/XP, MacOS, BeOS, OS/2, etc.
Ruby on Rails is a free web application framework. It aims to increase the speed and ease with which database-driven web sites can be created, and offers skeleton code frameworks (scaffolding) from the outset. Often shortened to Rails, or RoR, Ruby on Rails is an open source project written in the Ruby programming language, and applications using the Rails framework are developed using the Model-View-Controller design paradigm.
No comments yet

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: