Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Ruby Introduction

Ruby Introduction

Quick Ruby introduction for some friends

Alessandro Lepore

March 09, 2016
Tweet

More Decks by Alessandro Lepore

Other Decks in Programming

Transcript

  1. 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
  2. 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
  3. 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
  4. 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
  5. RUBY: THE BAD PARTS ➤ Performance ➤ Concurrency / Threading

    ➤ Alternate/less used syntaxes ➤ Dynamic typing (?) ➤ “The Standard Library is a ghetto” ➤ “Obscure” core development
  6. BASIC ENVIRONMENT ➤ Version manager (RVM, Rbenv..) ➤ shell ➤

    ruby ➤ irb ➤ gem ➤ bundle ➤ git ➤ your favourite editor