Login Register


A beginners guide to Ruby, Part 1 filter_list
Author
Message
A beginners guide to Ruby, Part 1 #1
Nightc||ed's Beginner Ruby Guide



Introduction


Ruby is a cross-platform interpreted language which has many features in common with other ‘scripting’ languages such as Perl and Python. It has an ‘English language’ style syntax which looks somewhat Pascal-like at first sight. It is thoroughly object oriented, and has a good deal in common with the greatgranddaddy of ‘pure’ OO languages, Smalltalk. It has been said that the languages which most influenced the development of Ruby were: Perl, Smalltalk, Eiffel, Ada and Lisp. The Ruby language was created by Yukihiro Matsumoto (commonly known as ‘Matz’) and it was first released in 1995.
- Book Of Ruby; © Huw Collingbourne

That's the textbook definition of the Ruby language, covering basic language relationship, history and syntax.

Some things to note


As mentioned in the introduction, I highly recommend learning Ruby if you already know Perl or Python as it's basically a cleaner python.
Spoiler: Example
Ruby:
Code:
puts "This." sleep

Python:
Code:
print("As compared to this.") wait = input()

Perl:
Code:
print "Or this.\n"; sleep;


Terminology


Ruby terminology is pretty easy to understand but I'll drop this here for later use in the tutorial
(Would be a lot more convenient if we had the table plugin, @Onion)
[spoiler=A-F]
Argument

An argument to a method is a named variable in the method's definition, or an object passed to a method when called.

Array

An ordered collection values, often assigned to a variable. in Ruby, the array takes the place of all ordered collections. They act as arrays, lists, stacks, queues, etc...

Benchmark

An evaluation of how fast computer software can run.

Boolean

An expression that outputs either True or False

Data Structure

A way of storing data in memory for later use

Define

"Define" is used to express how and when variables, classes and methods are first available for use.

DRY

Don't Repeat Yourself.
[/spoiler]
[spoiler=G-L]
GUI

Graphic User Interface

Hash

A named collection of key/value pairs

I/O

Input / Output

Iterate

"Visit" each element in a collection.
[/spoiler]
[spoiler=M-R]
Method

A function associated with a class or object.


Object

An 'object' refers to an instance of a class

Ruby on Rails (RoR)

MVC framework for web applications
[/spoiler]
[spoiler=S-Z]
Statement

A stand-alone piece of code.

String

Text

Syntax

"Grammatical" rules of a programming language.
[/spoiler]

CodeCademy Ruby Glossary


The Hello World

Code:
puts "Hello, world!" sleep




Hope you guys enjoyed part one of the series. Like for more!
-Nigthc||ed
It's often the outcasts, the iconoclasts ... those who have the least to lose because they
don't have much in the first place, who feel the new currents and ride them the farthest.

[+] 1 user Likes Inori's post
Reply





Messages In This Thread
A beginners guide to Ruby, Part 1 - by Inori - 03-31-2015, 04:43 PM
RE: A beginners guide to Ruby, Part 1 - by Master - 03-31-2015, 04:48 PM



Users browsing this thread: 1 Guest(s)