Slide 1

Slide 1 text

RUBY INTRODUCTION Alessandro Lepore

Slide 2

Slide 2 text

HISTORY ➤ Yukihiro Matsumoto (“Matz”), Japan ➤ Perl and Python…? ➤ 1995, Ruby 0.95 ➤ 2001, first English book, “Programming Ruby” ➤ 2003, Ruby 1.8, large amounts of changes ➤ 2004, RubyGems ➤ 2005, Ruby on Rails ➤ 2011, Ruby 1.9.3 ➤ 2013-2015: Ruby 2.0, 2.1, 2.2, 2.3

Slide 3

Slide 3 text

RUBY ➤ Dynamic, object-oriented, general-purpose programming language ➤ Influenced by Perl, Smalltalk, Eiffel, Ada, and Lisp ➤ Functional, object-oriented, and imperative ➤ Dynamic type system and automatic memory management ➤ Designed for programmer productivity and fun ➤ “…to be productive, and to enjoy programming, and to be happy. That is the primary purpose of Ruby language.” ➤ BSD / MIT license

Slide 4

Slide 4 text

RUBY VS PYTHON

Slide 5

Slide 5 text

RUBY ➤ Thoroughly object-oriented with inheritance, mixins and metaclasses ➤ Dynamic typing and duck typing ➤ Succinct and flexible syntax that minimises syntactic noise ➤ Dynamic reflection and alteration of objects to facilitate metaprogramming ➤ Lexical closures, iterators and generators, with a unique block syntax ➤ Strict boolean coercion rules (everything is true except false and nil) ➤ Exception handling ➤ Custom dispatch behaviour (through method_missing and const_missing) ➤ Native plug-in API in C ➤ Interactive Ruby Shell (a REPL) ➤ Centralised package management through RubyGems ➤ Implemented on all major platforms ➤ Large standard library, many gems ➤ Multiple implementations: CRuby (MRI), JRUBY, Rubinius, MRuby

Slide 6

Slide 6 text

RUBY ON RAILS ➤ Full stack web framework ➤ Optimizing for programmer happiness ➤ Convention over Configuration ➤ …and other controversial points since the beginning ➤ Must read: rubyonrails.org/doctrine

Slide 7

Slide 7 text

RUBY POPULARITY

Slide 8

Slide 8 text

FAMOUS STUFF

Slide 9

Slide 9 text

RUBY: THE BAD PARTS ➤ Performance ➤ Concurrency / Threading ➤ Alternate/less used syntaxes ➤ Dynamic typing (?) ➤ “The Standard Library is a ghetto” ➤ “Obscure” core development

Slide 10

Slide 10 text

BASIC ENVIRONMENT ➤ Version manager (RVM, Rbenv..) ➤ shell ➤ ruby ➤ irb ➤ gem ➤ bundle ➤ git ➤ your favourite editor

Slide 11

Slide 11 text

SHOW ME THE CODE

Slide 12

Slide 12 text

GENERAL CONCEPTS

Slide 13

Slide 13 text

GENERAL CONCEPTS

Slide 14

Slide 14 text

CLASSES, OBJECTS

Slide 15

Slide 15 text

LINKS ➤ https://www.ruby-lang.org/ ➤ http://tryruby.org/ ➤ https://rubygems.org/ ➤ http://rubyonrails.org/ ➤ https://www.ruby-toolbox.com/ ➤ http://www.helloruby.com/