SlideShare a Scribd company logo
RUBY                  Felipe Schmitt
an overall approach   PPRO@FEUP 2012
@schmittfelipe
CONTENTS

โ€ข   Rubyโ€™s history

โ€ข   What is Ruby?

โ€ข   Programming paradigms insight

โ€ข   How it works?

โ€ข   Rubyโ€™s usage

โ€ข   Where can I learn more?
RUBYโ€™S HISTORY
Timeline: 1993 - 2000


Yukihiro Matsumoto
โ€ข   Created in 1993

โ€ข   Popular only in Japan

โ€ข   All documentation written in Japanese
Timeline: 2000 - 2004

โ€ข   First english language book published in
    2000

โ€ข   Ruby has gained a lot of interest in Agile
    Development community but still
    unknown elsewhere
Timeline: 2004 - Today

โ€ข   Ruby on Rails, the framework that
    allowed ruby to step up to the spotlight

โ€ข   Ruby v1.9

โ€ข   Core 100% documented

โ€ข   96 standard libraries
WHAT IS RUBY?
โ€œI wanted a scripting language that was more powerful than Perl, and more object-
oriented than Python. That's why I decided to design my own language.โ€
                                                                            -Yukihiro Matsumoto
INFLUENCES

        Lisp

 Python
                               Ruby
CLU     Perl
      Smalltalk
WHAT IS RUBY?



โ€ขA dynamic, open source programming language with a focus on simplicity
 and productivity. It has an elegant syntax that is natural to read and easy to
 write.
PROGRAMMING PARADIGMS
Multi-paradigm programming language

                    โ€ข Functional


                    โ€ข Object   oriented

                    โ€ข Imperative


                    โ€ข Re๏ฌ‚ective




It also has a dynamic type system and automatic memory management;
HOW IT WORKS?
VS
Getting Started


HelloWorld.java

class HelloWorldApp {
   public static void main(String[] args) {
      System.out.println("Hello World!");
   }
}
Getting Started


HelloWorld.rb


    puts โ€œHello World!โ€




                          No main statement


                          No semicolons

                          ( )โ€™s are optional
Object

Java

       String s = String.ValueOf(1);
Object

Java

       String s = String.ValueOf(1);




Ruby

              s = 1.to_s
Object

Java

       String s = String.ValueOf(1);




Ruby

              s = 1.to_s

Everything is an object!
Types

Java

public void foo(ArrayList list) {
  list.add(โ€œfooโ€);
  }
Types

Java

public void foo(ArrayList list) {
  list.add(โ€œfooโ€);
  }



Ruby

def foo list
  list << โ€œfooโ€
end
Types

                  Java

                  public void foo(ArrayList list) {
                    list.add(โ€œfooโ€);
                    }



                  Ruby
                                     (?) return
                  def foo list
                    list << โ€œfooโ€
                  end
(?) Object type
Types
If list is a string: โ€˜fooโ€™

If list is an array: [โ€˜fooโ€™]

If list is a stream: foo is written to stream


Ruby

def foo list
  list << โ€œfooโ€
end
Duck Typing




โ€œIf it walks like a duck and quacks like a duck, it must be a duck.โ€

                                      - Pragmatic Dave Thomas
Iterators
  Objects manage their own transversal

       Ruby

       array.each { |item|
         puts item
         }




No for loops:
     Loops                   N + 1 errors
Open classes
   Ruby

     class Array
       def average
        inject do |sum, var|
            sum + var
          end / size
       end
     end

     nums = [1,2,3,4,5]
     puts nums.average                  #prints: 3

Existing classes can be modi๏ฌed at any time.
WHOโ€™S USING RUBY?
Ruby an overall approach
RECAP

In๏ฌ‚uences                             Style                   Overall
โ€ข   Perlโ€™s syntax                     โ€ข   Simplicity          โ€ข   Everything is an object
โ€ข   Smalltalkโ€™s semantics             โ€ข   Productivity        โ€ข   Flexible
โ€ข   Pythonโ€™s design philosophy        โ€ข   Elegant syntax      โ€ข   Large standard library




                    โ€œActually, I'm trying to make Ruby natural, not simple.โ€
                                                                      - Matz
MORE STUFF
                                      Books
              Beginning Ruby: From Novice to Professional (2009)
                      The Expertโ€™s Voice by Peter Cooper

                       The Ruby Programming Language (2008)
                   Oโ€™reilly by David Flanagan and Yukihiro Matsumoto

                Agile Web Development with Rails (2011) 4th edition
  Pragmatic Programmers by Sam Ruby, Dave Thomas and David Heinemeier Hansson

                                       Web
                               http://www.ruby-lang.org/
             http://www.slideshare.net/mbowler/ruby-for-java-programmers
http://www.slideshare.net/vishnu/the-top-10-reasons-the-ruby-programming-language-sucks
                      http://www.๏ฌncher.org/tips/Languages/Ruby/
Ad

More Related Content

What's hot (20)

Ruby On Rails Introduction
Ruby On Rails IntroductionRuby On Rails Introduction
Ruby On Rails Introduction
Thomas Fuchs
ย 
Bitter Java, Sweeten with JRuby
Bitter Java, Sweeten with JRubyBitter Java, Sweeten with JRuby
Bitter Java, Sweeten with JRuby
Brian Sam-Bodden
ย 
RubyonRails
RubyonRailsRubyonRails
RubyonRails
webuploader
ย 
Ruby on Rails : First Mile
Ruby on Rails : First MileRuby on Rails : First Mile
Ruby on Rails : First Mile
Gourab Mitra
ย 
Making CLI app in ruby
Making CLI app in rubyMaking CLI app in ruby
Making CLI app in ruby
Huy Do
ย 
Ruby Metaprogramming 08
Ruby Metaprogramming 08Ruby Metaprogramming 08
Ruby Metaprogramming 08
Brian Sam-Bodden
ย 
Ruby On Rails Basics
Ruby On Rails BasicsRuby On Rails Basics
Ruby On Rails Basics
Amit Solanki
ย 
Pengantar Ruby on Rails
Pengantar Ruby on RailsPengantar Ruby on Rails
Pengantar Ruby on Rails
Ashari Juang
ย 
Rubykaigi 2017-nishimotz-v6
Rubykaigi 2017-nishimotz-v6Rubykaigi 2017-nishimotz-v6
Rubykaigi 2017-nishimotz-v6
Takuya Nishimoto
ย 
Ruby on Rails 3
Ruby on Rails 3Ruby on Rails 3
Ruby on Rails 3
Stefan Fodor
ย 
Ruby Beyond Rails
Ruby Beyond RailsRuby Beyond Rails
Ruby Beyond Rails
Gaveen Prabhasara
ย 
Opal - Ruby Style!! Ruby in the browser
Opal - Ruby Style!!  Ruby in the browserOpal - Ruby Style!!  Ruby in the browser
Opal - Ruby Style!! Ruby in the browser
Forrest Chang
ย 
Opal chapter 4_a_new_hope
Opal chapter 4_a_new_hopeOpal chapter 4_a_new_hope
Opal chapter 4_a_new_hope
Forrest Chang
ย 
Ruby and Rails by Example (GeekCamp edition)
Ruby and Rails by Example (GeekCamp edition)Ruby and Rails by Example (GeekCamp edition)
Ruby and Rails by Example (GeekCamp edition)
bryanbibat
ย 
Crystal
CrystalCrystal
Crystal
Kamil Lelonek
ย 
JRoR Deploying Rails on JRuby
JRoR Deploying Rails on JRubyJRoR Deploying Rails on JRuby
JRoR Deploying Rails on JRuby
elliando dias
ย 
Ruby on Rails Introduction M&P - IT Skill Development Program 07
Ruby on Rails Introduction M&P - IT Skill Development Program 07Ruby on Rails Introduction M&P - IT Skill Development Program 07
Ruby on Rails Introduction M&P - IT Skill Development Program 07
Muhammad Sunny โœˆ
ย 
Introduction To Rails
Introduction To RailsIntroduction To Rails
Introduction To Rails
Eric Gruber
ย 
Ruby on Rails Presentation
Ruby on Rails PresentationRuby on Rails Presentation
Ruby on Rails Presentation
Michael MacDonald
ย 
Web application intro + a bit of ruby (revised)
Web application intro + a bit of ruby (revised)Web application intro + a bit of ruby (revised)
Web application intro + a bit of ruby (revised)
Tobias Pfeiffer
ย 
Ruby On Rails Introduction
Ruby On Rails IntroductionRuby On Rails Introduction
Ruby On Rails Introduction
Thomas Fuchs
ย 
Bitter Java, Sweeten with JRuby
Bitter Java, Sweeten with JRubyBitter Java, Sweeten with JRuby
Bitter Java, Sweeten with JRuby
Brian Sam-Bodden
ย 
RubyonRails
RubyonRailsRubyonRails
RubyonRails
webuploader
ย 
Ruby on Rails : First Mile
Ruby on Rails : First MileRuby on Rails : First Mile
Ruby on Rails : First Mile
Gourab Mitra
ย 
Making CLI app in ruby
Making CLI app in rubyMaking CLI app in ruby
Making CLI app in ruby
Huy Do
ย 
Ruby Metaprogramming 08
Ruby Metaprogramming 08Ruby Metaprogramming 08
Ruby Metaprogramming 08
Brian Sam-Bodden
ย 
Ruby On Rails Basics
Ruby On Rails BasicsRuby On Rails Basics
Ruby On Rails Basics
Amit Solanki
ย 
Pengantar Ruby on Rails
Pengantar Ruby on RailsPengantar Ruby on Rails
Pengantar Ruby on Rails
Ashari Juang
ย 
Rubykaigi 2017-nishimotz-v6
Rubykaigi 2017-nishimotz-v6Rubykaigi 2017-nishimotz-v6
Rubykaigi 2017-nishimotz-v6
Takuya Nishimoto
ย 
Ruby on Rails 3
Ruby on Rails 3Ruby on Rails 3
Ruby on Rails 3
Stefan Fodor
ย 
Opal - Ruby Style!! Ruby in the browser
Opal - Ruby Style!!  Ruby in the browserOpal - Ruby Style!!  Ruby in the browser
Opal - Ruby Style!! Ruby in the browser
Forrest Chang
ย 
Opal chapter 4_a_new_hope
Opal chapter 4_a_new_hopeOpal chapter 4_a_new_hope
Opal chapter 4_a_new_hope
Forrest Chang
ย 
Ruby and Rails by Example (GeekCamp edition)
Ruby and Rails by Example (GeekCamp edition)Ruby and Rails by Example (GeekCamp edition)
Ruby and Rails by Example (GeekCamp edition)
bryanbibat
ย 
JRoR Deploying Rails on JRuby
JRoR Deploying Rails on JRubyJRoR Deploying Rails on JRuby
JRoR Deploying Rails on JRuby
elliando dias
ย 
Ruby on Rails Introduction M&P - IT Skill Development Program 07
Ruby on Rails Introduction M&P - IT Skill Development Program 07Ruby on Rails Introduction M&P - IT Skill Development Program 07
Ruby on Rails Introduction M&P - IT Skill Development Program 07
Muhammad Sunny โœˆ
ย 
Introduction To Rails
Introduction To RailsIntroduction To Rails
Introduction To Rails
Eric Gruber
ย 
Ruby on Rails Presentation
Ruby on Rails PresentationRuby on Rails Presentation
Ruby on Rails Presentation
Michael MacDonald
ย 
Web application intro + a bit of ruby (revised)
Web application intro + a bit of ruby (revised)Web application intro + a bit of ruby (revised)
Web application intro + a bit of ruby (revised)
Tobias Pfeiffer
ย 

Similar to Ruby an overall approach (20)

Why i love ruby than x
Why i love ruby than xWhy i love ruby than x
Why i love ruby than x
Samnang Chhun
ย 
Introduction to Ruby
Introduction to RubyIntroduction to Ruby
Introduction to Ruby
Mark Menard
ย 
Intro To Ror
Intro To RorIntro To Ror
Intro To Ror
myuser
ย 
Ruby on Rails Training - Module 1
Ruby on Rails Training - Module 1Ruby on Rails Training - Module 1
Ruby on Rails Training - Module 1
Mark Menard
ย 
Meta Programming in Ruby - Code Camp 2010
Meta Programming in Ruby - Code Camp 2010Meta Programming in Ruby - Code Camp 2010
Meta Programming in Ruby - Code Camp 2010
ssoroka
ย 
Ruby tutorial
Ruby tutorialRuby tutorial
Ruby tutorial
knoppix
ย 
Introduction to Ruby & Modern Programming
Introduction to Ruby & Modern ProgrammingIntroduction to Ruby & Modern Programming
Introduction to Ruby & Modern Programming
Christos Sotirelis
ย 
Why ruby
Why rubyWhy ruby
Why ruby
Bill Chea
ย 
JRuby: The Hard Parts
JRuby: The Hard PartsJRuby: The Hard Parts
JRuby: The Hard Parts
Charles Nutter
ย 
ruby_vs_perl_and_python
ruby_vs_perl_and_pythonruby_vs_perl_and_python
ruby_vs_perl_and_python
tutorialsruby
ย 
ruby_vs_perl_and_python
ruby_vs_perl_and_pythonruby_vs_perl_and_python
ruby_vs_perl_and_python
tutorialsruby
ย 
Intro for RoR
Intro for RoRIntro for RoR
Intro for RoR
Vigneshwaran Seetharaman
ย 
Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1
Henry S
ย 
Intro To Ror
Intro To RorIntro To Ror
Intro To Ror
guest5dedf5
ย 
Ruby introductions
Ruby introductionsRuby introductions
Ruby introductions
Binh Bui
ย 
JRuby - The Best of Java and Ruby
JRuby - The Best of Java and RubyJRuby - The Best of Java and Ruby
JRuby - The Best of Java and Ruby
Evgeny Rahman
ย 
Adventures of java developer in ruby world
Adventures of java developer in ruby worldAdventures of java developer in ruby world
Adventures of java developer in ruby world
Orest Ivasiv
ย 
10 Things you should know about Ruby
10 Things you should know about Ruby10 Things you should know about Ruby
10 Things you should know about Ruby
sikachu
ย 
Learn Ruby 2011 - Session 1
Learn Ruby 2011 - Session 1Learn Ruby 2011 - Session 1
Learn Ruby 2011 - Session 1
James Thompson
ย 
Ruby
RubyRuby
Ruby
Aizat Faiz
ย 
Why i love ruby than x
Why i love ruby than xWhy i love ruby than x
Why i love ruby than x
Samnang Chhun
ย 
Introduction to Ruby
Introduction to RubyIntroduction to Ruby
Introduction to Ruby
Mark Menard
ย 
Intro To Ror
Intro To RorIntro To Ror
Intro To Ror
myuser
ย 
Ruby on Rails Training - Module 1
Ruby on Rails Training - Module 1Ruby on Rails Training - Module 1
Ruby on Rails Training - Module 1
Mark Menard
ย 
Meta Programming in Ruby - Code Camp 2010
Meta Programming in Ruby - Code Camp 2010Meta Programming in Ruby - Code Camp 2010
Meta Programming in Ruby - Code Camp 2010
ssoroka
ย 
Ruby tutorial
Ruby tutorialRuby tutorial
Ruby tutorial
knoppix
ย 
Introduction to Ruby & Modern Programming
Introduction to Ruby & Modern ProgrammingIntroduction to Ruby & Modern Programming
Introduction to Ruby & Modern Programming
Christos Sotirelis
ย 
Why ruby
Why rubyWhy ruby
Why ruby
Bill Chea
ย 
JRuby: The Hard Parts
JRuby: The Hard PartsJRuby: The Hard Parts
JRuby: The Hard Parts
Charles Nutter
ย 
ruby_vs_perl_and_python
ruby_vs_perl_and_pythonruby_vs_perl_and_python
ruby_vs_perl_and_python
tutorialsruby
ย 
ruby_vs_perl_and_python
ruby_vs_perl_and_pythonruby_vs_perl_and_python
ruby_vs_perl_and_python
tutorialsruby
ย 
Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1
Henry S
ย 
Intro To Ror
Intro To RorIntro To Ror
Intro To Ror
guest5dedf5
ย 
Ruby introductions
Ruby introductionsRuby introductions
Ruby introductions
Binh Bui
ย 
JRuby - The Best of Java and Ruby
JRuby - The Best of Java and RubyJRuby - The Best of Java and Ruby
JRuby - The Best of Java and Ruby
Evgeny Rahman
ย 
Adventures of java developer in ruby world
Adventures of java developer in ruby worldAdventures of java developer in ruby world
Adventures of java developer in ruby world
Orest Ivasiv
ย 
10 Things you should know about Ruby
10 Things you should know about Ruby10 Things you should know about Ruby
10 Things you should know about Ruby
sikachu
ย 
Learn Ruby 2011 - Session 1
Learn Ruby 2011 - Session 1Learn Ruby 2011 - Session 1
Learn Ruby 2011 - Session 1
James Thompson
ย 
Ad

Recently uploaded (20)

DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
ย 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
ย 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
ย 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
ย 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
ย 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
ย 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
ย 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
ย 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
ย 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
ย 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
ย 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
ย 
Drupalcamp Finland โ€“ Measuring Front-end Energy Consumption
Drupalcamp Finland โ€“ Measuring Front-end Energy ConsumptionDrupalcamp Finland โ€“ Measuring Front-end Energy Consumption
Drupalcamp Finland โ€“ Measuring Front-end Energy Consumption
Exove
ย 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
ย 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
ย 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
ย 
HCL Nomad Web โ€“ Best Practices and Managing Multiuser Environments
HCL Nomad Web โ€“ Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web โ€“ Best Practices and Managing Multiuser Environments
HCL Nomad Web โ€“ Best Practices and Managing Multiuser Environments
panagenda
ย 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
ย 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
ย 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
ย 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
ย 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
ย 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
ย 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
ย 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
ย 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
ย 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
ย 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
ย 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
ย 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
ย 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
ย 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
ย 
Drupalcamp Finland โ€“ Measuring Front-end Energy Consumption
Drupalcamp Finland โ€“ Measuring Front-end Energy ConsumptionDrupalcamp Finland โ€“ Measuring Front-end Energy Consumption
Drupalcamp Finland โ€“ Measuring Front-end Energy Consumption
Exove
ย 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
ย 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
ย 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
ย 
HCL Nomad Web โ€“ Best Practices and Managing Multiuser Environments
HCL Nomad Web โ€“ Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web โ€“ Best Practices and Managing Multiuser Environments
HCL Nomad Web โ€“ Best Practices and Managing Multiuser Environments
panagenda
ย 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
ย 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
ย 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
ย 
Ad

Ruby an overall approach

  • 1. RUBY Felipe Schmitt an overall approach PPRO@FEUP 2012
  • 3. CONTENTS โ€ข Rubyโ€™s history โ€ข What is Ruby? โ€ข Programming paradigms insight โ€ข How it works? โ€ข Rubyโ€™s usage โ€ข Where can I learn more?
  • 5. Timeline: 1993 - 2000 Yukihiro Matsumoto โ€ข Created in 1993 โ€ข Popular only in Japan โ€ข All documentation written in Japanese
  • 6. Timeline: 2000 - 2004 โ€ข First english language book published in 2000 โ€ข Ruby has gained a lot of interest in Agile Development community but still unknown elsewhere
  • 7. Timeline: 2004 - Today โ€ข Ruby on Rails, the framework that allowed ruby to step up to the spotlight โ€ข Ruby v1.9 โ€ข Core 100% documented โ€ข 96 standard libraries
  • 9. โ€œI wanted a scripting language that was more powerful than Perl, and more object- oriented than Python. That's why I decided to design my own language.โ€ -Yukihiro Matsumoto
  • 10. INFLUENCES Lisp Python Ruby CLU Perl Smalltalk
  • 11. WHAT IS RUBY? โ€ขA dynamic, open source programming language with a focus on simplicity and productivity. It has an elegant syntax that is natural to read and easy to write.
  • 13. Multi-paradigm programming language โ€ข Functional โ€ข Object oriented โ€ข Imperative โ€ข Re๏ฌ‚ective It also has a dynamic type system and automatic memory management;
  • 15. VS
  • 16. Getting Started HelloWorld.java class HelloWorldApp { public static void main(String[] args) { System.out.println("Hello World!"); } }
  • 17. Getting Started HelloWorld.rb puts โ€œHello World!โ€ No main statement No semicolons ( )โ€™s are optional
  • 18. Object Java String s = String.ValueOf(1);
  • 19. Object Java String s = String.ValueOf(1); Ruby s = 1.to_s
  • 20. Object Java String s = String.ValueOf(1); Ruby s = 1.to_s Everything is an object!
  • 21. Types Java public void foo(ArrayList list) { list.add(โ€œfooโ€); }
  • 22. Types Java public void foo(ArrayList list) { list.add(โ€œfooโ€); } Ruby def foo list list << โ€œfooโ€ end
  • 23. Types Java public void foo(ArrayList list) { list.add(โ€œfooโ€); } Ruby (?) return def foo list list << โ€œfooโ€ end (?) Object type
  • 24. Types If list is a string: โ€˜fooโ€™ If list is an array: [โ€˜fooโ€™] If list is a stream: foo is written to stream Ruby def foo list list << โ€œfooโ€ end
  • 25. Duck Typing โ€œIf it walks like a duck and quacks like a duck, it must be a duck.โ€ - Pragmatic Dave Thomas
  • 26. Iterators Objects manage their own transversal Ruby array.each { |item| puts item } No for loops: Loops N + 1 errors
  • 27. Open classes Ruby class Array def average inject do |sum, var| sum + var end / size end end nums = [1,2,3,4,5] puts nums.average #prints: 3 Existing classes can be modi๏ฌed at any time.
  • 30. RECAP In๏ฌ‚uences Style Overall โ€ข Perlโ€™s syntax โ€ข Simplicity โ€ข Everything is an object โ€ข Smalltalkโ€™s semantics โ€ข Productivity โ€ข Flexible โ€ข Pythonโ€™s design philosophy โ€ข Elegant syntax โ€ข Large standard library โ€œActually, I'm trying to make Ruby natural, not simple.โ€ - Matz
  • 31. MORE STUFF Books Beginning Ruby: From Novice to Professional (2009) The Expertโ€™s Voice by Peter Cooper The Ruby Programming Language (2008) Oโ€™reilly by David Flanagan and Yukihiro Matsumoto Agile Web Development with Rails (2011) 4th edition Pragmatic Programmers by Sam Ruby, Dave Thomas and David Heinemeier Hansson Web http://www.ruby-lang.org/ http://www.slideshare.net/mbowler/ruby-for-java-programmers http://www.slideshare.net/vishnu/the-top-10-reasons-the-ruby-programming-language-sucks http://www.๏ฌncher.org/tips/Languages/Ruby/