CSC/ECE 517 Fall 2011/ch3 3a av: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 3: Line 3:


==What is Ruby?==
==What is Ruby?==
Ruby is a reflective, dynamically typed, object-oriented and single-pass interpreted language. Lot of Jargon? Hmm...
Ruby is a reflective, dynamically typed, object-oriented and single-pass interpreted language. Lot of Jargon? Hmm...<br>
'''Reflective - ''' Ruby can modify its behavior at one or more points, based on the input it receives pertaining to that.
'''Reflective - ''' Ruby can modify its behavior at one or more points, based on the input it receives pertaining to that.<br>
'''Object oriented - ''' Ruby is a purely object oriented language. There are absolutely no primitive data types at all in Ruby. Or in other words, every entity and data type is treated as an object in Ruby.
'''Object oriented - ''' Ruby is a purely object oriented language. There are absolutely no primitive data types at all in Ruby. Or in other words, every entity and data type is treated as an object in Ruby.<br>
'''Dynamically typed - ''' The objects get their data type and behavior only AFTER an assignment has been made into it. In other words, after a variable is ''declared'', it can end up being an object of ''any'' type.
'''Dynamically typed - ''' The objects get their data type and behavior only AFTER an assignment has been made into it. In other words, after a variable is ''declared'', it can end up being an object of ''any'' type.<br>
'''Single pass interpreted - ''' The program is executed line by line after the call is made. This is one of the main reasons for ruby's flexibility.
'''Single pass interpreted - ''' The program is executed line by line after the call is made. This is one of the main reasons for ruby's flexibility.



Revision as of 19:29, 29 September 2011

Introduction

This chapter aims to provide the user a nice and smooth transition to programming in Ruby. This article is written in the stand-point of a user who is already familiar with the general Hows and Whats and Whys of programming in C++ and/or Java. This article also provides numerous code snippets that the user can use to get used to Ruby.

What is Ruby?

Ruby is a reflective, dynamically typed, object-oriented and single-pass interpreted language. Lot of Jargon? Hmm...
Reflective - Ruby can modify its behavior at one or more points, based on the input it receives pertaining to that.
Object oriented - Ruby is a purely object oriented language. There are absolutely no primitive data types at all in Ruby. Or in other words, every entity and data type is treated as an object in Ruby.
Dynamically typed - The objects get their data type and behavior only AFTER an assignment has been made into it. In other words, after a variable is declared, it can end up being an object of any type.
Single pass interpreted - The program is executed line by line after the call is made. This is one of the main reasons for ruby's flexibility.

Installation

In this section we shall focus on installing Ruby on two different platforms, Windows and Linux.

Windows

For windows all the user needs to do is visit this page and download the Ruby installer. It is a self extracting executable, so all the user has to do is click and wait!