SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Thread: What is Ruby?

  1. #1
    SitePoint Wizard Another Designer's Avatar
    Join Date
    May 2005
    Posts
    1,370
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    What is Ruby?

    I have no idea what Ruby is. Would anyone be so kind to explain it to me?

    Thanks

  2. #2
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Ruby's a general-purpose scripting language like Perl or Python that also happens to be used to build dynamic websites. It basically does the same things that PHP and other languages do as far as websites are concerned.

    More info: http://en.wikipedia.org/wiki/Ruby_programming_language

  3. #3
    Designer/Developer FarooqAzam's Avatar
    Join Date
    May 2004
    Location
    Pakistan
    Posts
    217
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok lets explain you :-

    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, extensible, and portable.

    Oh, I need to mention, it's totally free, which means not only free of charge, but also freedom to use, copy, modify, and distribute it.

    Features of Ruby
    Ruby has simple syntax, partially inspired by Eiffel and Ada.
    Ruby has exception handling features, like Java or Python, to make it easy to handle errors.
    Ruby's operators are syntax sugar for the methods. You can redefine them easily.
    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.
    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.
    Ruby features single inheritance only, *on purpose*. But Ruby knows the concept of modules (called Categories in Objective-C). 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!).
    Ruby features true closures. Not just unnamed function, but with present variable bindings.
    Ruby features blocks in its syntax (code surrounded by '{' ... '}' or 'do' ... 'end'). These blocks can be passed to methods, or converted into closures.
    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. This is better for your health. ;-)
    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.
    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.
    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.
    Ruby can load extension libraries dynamically if an OS allows.
    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! ;-)
    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.

  4. #4
    SitePoint Enthusiast sitecritique's Avatar
    Join Date
    Jan 2005
    Location
    USA
    Posts
    56
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I just discovered this forum and Ruby... My brother has done OO with Smalltalk for 22 years - I'm ALL over this and will be installing it ASAP!

  5. #5
    SitePoint Zealot logitron's Avatar
    Join Date
    Feb 2006
    Posts
    144
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ruby is the future! It will consume you all! Muhahahaha!

    ~Patrick Smith~

  6. #6
    throw me a bone ... now bonefry's Avatar
    Join Date
    Nov 2004
    Location
    Romania
    Posts
    848
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    @Farooqaaa, why do you copy/paste text from http://www.ruby-lang.org/en/20020101.html without mentioning it ?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •