My language is equally pretty (if not more) as yours

My language is Ruby (http://www.ruby-lang.org).

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 many parentheses, Ruby is your choice. There are little reasons not to love Ruby. One of the most asked question is, why I chose Ruby over traditional languages like PHP or Python. Here’s why:

*Interpretive :

Ruby is an interpreted language, so you don’t have to recompile programs written in Ruby to execute them.

*Variables have no type :

Variables in Ruby can contain data of any type. You don’t have to worry about variable typing. Consequently, it has a weaker compile time check.

*No declaration needed :

You can use variables in your Ruby programs without any declarations. Variable names denote their scope – global, class, instance, or local.

*Simple syntax :

Ruby has a simple syntax influenced slightly from Eiffel. No semicolon to end the line. Language should understand the human nature. Not the other way round. Ruby looks and feels a lot like English.

*No user-level memory management :

Ruby has automatic memory management. Objects no longer referenced from anywhere are automatically collected by the garbage collector built into the interpreter.

*Everything is an object :

Ruby is a purely object-oriented language, and was so since its creation. Even such basic data as integers are seen as objects. Yes, Ruby has object orientation 2.0.

*Class, inheritance, and methods :

Being an object-oriented language, Ruby naturally has basic features like classes, inheritance, and methods. And Ruby’s built in method (function for you :P) is gorgeous. It reads a lot like English and often times, you can guess the method name from Intuition.

*Singleton methods :

Ruby has the ability to define methods for certain objects. For example, you can define a press-button action for certain widget 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.

*Mix-in by modules :

Ruby intentionally does not have the multiple inheritance as it is a source of confusion. Instead, Ruby has the ability to share implementations across the inheritance tree. This is often called a ‘Mix-in’.

*Iterators :

Ruby has iterators for loop abstraction.

*Closures :

In Ruby, you can objectify the procedure.

*Text processing and regular expressions :

Ruby has a bunch of text processing features like in Perl.

*M17N, character set independent :

Ruby supports multilingualism in programming. Easy to process texts written in many different natural languages and encoded in many different character encodings, without dependence on Unicode.

*Bignums :

With built-in bignums, you can for example calculate factorial(400).

*Reflection and domain specific languages :

Class is also an instance of the Class class. Definition of classes and methods is an expression just as 1+1 is. So your programs can even write and modify programs. Thus you can write your application in your own programming language on top of Ruby.

*Direct access to the OS :

Ruby can use most UNIX system calls, often used in system programming.

*Dynamic loading :

On most UNIX systems, you can load object files into the Ruby interpreter on-the-fly.

*Rich libraries :

Libraries called “builtin libraries” and “standard libraries” are bundled with Ruby. And you can obtain more libraries via the package management system called `RubyGems’.

Moreover there are thousands of Ruby projects in Rubyforge (http://www.rubyforge.org) and RAA (http://raa.ruby-lang.org). Don’t forget to check out the ever so wonderful Github. It hosts a plethora of Ruby code example :-)

I see a future Rubyist reading this, now don’t you dare disappointing me. Happy Ruby coding, mate :)

About these ads

4 comments on “My language is equally pretty (if not more) as yours

  1. To your last line,
    Sorry to disappoint you. I ended up reading this post :P

  2. Kabbo Sarker says:

    haha, the last line is funny, I won’t try to disappoint you (I guess) :P
    Well, for now my only love is for python as I know nothing without it. You know, the wife who has never seen any man in her life will think her husband is the best, no? ;-)
    If I live, and live well, I’ll learn it. Well, Abhi vai is telling me to learn C# and you ruby. I am enjoying all this LOL

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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