CSC/ECE 517 Fall 2011/ch3 3a av

From Expertiza_Wiki
Revision as of 19:28, 29 September 2011 by Vsuresw (talk | contribs)
Jump to navigation Jump to search

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!