SlideShare uma empresa Scribd logo
1 de 100
Baixar para ler offline
RubyConf China
Why Ruby?
Yukihiro "Matz" Matsumoto
まつもと ゆきひろ
matz@ruby-lang.org
Copyright (c) 2008 Yukihiro "Matz" Matsumoto, No rights reserved
thou
Moore’s Law
The number of Transistors
in LSI Doubles Every
18 Months
Moore’s Law Means:
Computer Grows Exponentially
Faster
Cheaper
More Common
Faster Computer
PCs are Faster than Super
Computers of 20 Years Ago
Cheaper Computers
We can Buy a PC for $400 Now
Common Computers
Now Everyone Owns Computers
Personal Computers
Cell Phones
Cell Phone as a Computer
Cell Phone as a Computer
Everyone is Connected
Broadband
WiFi
Mobile Networks
Influence in Programming
Moore’s Law Changes
Software Complexity
Programming Languages
Software Complexity
No Business Can Be Run
without Software
We Need More Software
Quicker
Cheaper
Humans Don’t Improve
Moore’s Law Does Not Apply to
Humans
Productivity
We Need More Software with
Limited Resources
Productivity
We Have Faster Computers
Development Efficiency At the
Cost of Runtime Efficiency
Productivity
The Most Important Factor of
Language Evolution
Languages are One of the Tools
for Productivity
How Languages Help
Productivity
Sapir-Whorf hypothesis
Language determines the way
we think.
Theorem #1
Languages influence
human thought,
more than you think
Programming Languages
Do programming
languages
influence human
thoughts?
Thinking in Programming
Language
Natural languages are too
ambiguous.
Or, too verbose.
Or, too indirect.
Thinking in Programming
Language.
If programmers think in
programming languages,
They must influence thoughts
as much as
natural languages do.
Theorem #2
"languages" in
Theorem #1 includes
programming
languages.
Why don’t you choose a good
language?
Programming
langugages are so
easy to learn.
What is a good language?
The language that helps thinking
Recursion
BASIC did not allow recursion
Factorial
def fact(n)
if n == 0
1
else
n * fact(n - 1)
end
end
print "6!=", fact(6), "n"
6!=740
A good Language
does not restrict our thought
Factorial Again
print "200!=", fact(200), "n"
200!=78865786736479050355236321393218506
2295135977687173263294742533244359449963
4033429203042840119846239041772121389196
3883025764279024263710506192662495282993
1113462857270763317237396988943922445621
4516642402540332918641312274282948532775
2424240757390324032125740557956866022603
1904170324062351700858796178922222789623
7038973747200000000000000000000000000000
00000000000000000000
Less Restriction
print "200!=", fact(200), "n"
200!=788657867364790503552363213932185062295
13597768717326329474253324435944996340334292
03042840119846239041772121389196388302576427
90242637105061926624952829931113462857270763
31723739698894392244562145166424025403329186
41312274282948532775242424075739032403212574
05579568660226031904170324062351700858796178
92222278962370389737472000000000000000000000
0000000000000000000000000000
Ruby
A good language
Consise
Succinctness is Power
by Paul Graham
Fred Brooks’ Law
Less Lines ≒ Effective
Succinctness is Power
Less Code, Less Bugs
Less Bugs, You Feel Yourself
Smarter.
You can be 10 times (or even
1000 times) more productive
More Factorial
class Factorial {
private static int fact(int n) {
if (n == 1) return 1;
return n * fact(n - 1);
}
public static void main(String[] argv) {
System.out.println("6!="+fact(6));
}
}
6!=740
Succinctness Example
def fact(n)
if n == 1
1
else
n * fact(n - 1)
end
end
print "6!=", fact(6), "n"
6!=740
Ruby
A good language
Inspiring
Functional Factorial
def fact(n)
(1..n).inject(:*)
end
print "6!=", fact(6), "n"
6!=740
A good language
makes better programming
experience
For Better Programming
Experience
Learnability
Efficiency
Memorability
Errors
Satisfaction
According to Dr. Jacob Nielsen
Learnability
How easy is it for users to
accomplish basic tasks the first
time they encounter the design?
Learnability
Usability for Beginners
Important to Acquire New Users
"Common Sense" is the Key
Efficiency
Once users have learned the
design, how quickly can they
perform tasks?
Efficiency
More important than learnability
Efficiency is the top purpose of
languages
Memorability
When users return to the design
after a period of not using it, how
easily can they reestablish
proficiency?
Memorability
Association
Consistency
Orthogonality
Common Sense
No Radical
Errors
How many errors do users make,
how severe are these errors, and
how easily can they recover from
these errors?
Errors
When you see repeated errors,
you have to do something.
Errors are the source of design
inspiration.
Satisfaction
How pleasant is it to use the
design?
Satisfaction
We program to have fun.
Even when we program for
money, we want to have fun as
well.
How Ruby Serves
Learnability
Efficiency
Memorability
Errors
Satisfaction
How Ruby Serves
Learnability
Efficiency
Memorability
Errors
Satisfaction
Learnability
Ruby is very conservative except
for a few places
Quick to learn
Quick to try
Learnability Example
Hello World!
print "Hello Worldn"
Hello World
How Ruby Serves
Learnability
Efficiency
Memorability
Errors
Satisfaction
Efficiency
No Run-Time Efficiency
Ruby focuses on the cost
of programming.
Devlopment Efficiency
Ruby focuses on the cost of
programming by
Simplicity
Consistency
Smartness
Simplicity
Do you like programming
language to be simple?
Probably you do.
Simplicity
Does language simplicity really
help you?
not always.
need more complex tool
sometimes
Need More Complex Tool
Knife vs Chain Saw
Bicycle vs Airplane
Human Heart: No Simple
We love simplicity
We love complexity
We love easy problems
We hate easy problems
Pseudo-Simplicity
Ruby is NOT a simple
language.
Simplicity Example
Rakefile
Rake = Ruby Make
task :default => [:test]
task :test do
ruby "test/unittest.rb"
end
Simplicity Example
In Simpler Syntax
task({:default => [:test]})
task(:test, lambda(){
ruby "test/unittest.rb"
})
Solution-Simplicity
Tool Complexity is OK
if it makes the Solution Simple
Efficiency Example
/bin/cat in Ruby
puts ARGF
It would be more than 50 lines of
code in C
How Ruby Serves
Learnability
Efficiency
Memorability
Errors
Satisfaction
Memorability
Conservativeness helps here too
Easy-to-remember syntax
Ruby looks like other languages
Memorability Example
Can you write /bin/cat -n without
looking anything?
I can, if I use Ruby.
ARGF.each_with_index{|line,i|
printf "%4d %s",i,line
}
How Ruby Serves
Learnability
Efficiency
Memorability
Errors
Satisfaction
Errors
You will see less errors due to
Consistent Syntax Rules
Succinct Code
Less code, Less bug.
How Ruby Serves
Learnability
Efficiency
Memorability
Errors
Satisfaction
Satisfaction
As a result, Ruby is fun to use.
It makes you feel smarter.
Ruby the Language
Ruby is Good for
Text Processing
Web Programming
XML Programming
GUI Applications
Ruby is Good for
Bioinformatics
eXtreme Programming
"I love it. Conceptually it is really clean and sweet."
-- Kent Beck
Why I created Ruby
Just for Fun
Tool for me myself
Ideal tool for Everyday Task
How I created Ruby
Combine Good Things from the
Past
Design Conservative
Design a Tool I Want to Use
To Have Fun
The History of
the Ruby Language
Pre-History
OO Fanboy
Language Geek
In 1993
Project Started
Mere Hobby
Goals
Scripting
a la Perl
Nice Clean Syntax
With OO
Real Goal
To Enjoy
Making Language
Implementation
Programming
Process
Lisp Semantics
Smalltalk OO
Conservative Syntax
Process
Deconstruct Perl
Reorganize into Class Library
Process
Iterators from CLU
Higher-order Functions using
Blocks
Process
Some Spice from Python
..and other languages
Released
1995-12-21
fj.sources
In 1997
Hired by NaCl
Became Full-time OSS
Developer
In 1999
First Book
In 2000
First English Book
Ruby in early 2000s
Became a Language
for Geeks
In 2004
Ruby on Rails
Ruby on Rails
Web Application
Framework
Web development that doesn’t hurt
Ruby on Rails
10x Productive than Java
15 Minutes to code Blog
Enterprise Ruby
Ruby started to be used in the
Enterprise Environment
Enterprise Ruby
Concerns
Fast Enough?
Scales?
Enterprise Ruby
Issues are Matters of
Resource/Money We Put in.
Ruby’s Mindshare
From Java To Ruby
What’s "Enterprise"?
What Major Players
Recommend:
Sun Microsystems
Microsoft
Apple
Etc.
Why Ruby?
Ruby is Productive
Ruby is Motivating
Ruby is Fun
A Message from Ruby
Enjoy Programming!

Mais conteúdo relacionado

Mais procurados

Workin ontherailsroad
Workin ontherailsroadWorkin ontherailsroad
Workin ontherailsroad
Jim Jones
 
Ruby Introduction
Ruby IntroductionRuby Introduction
Ruby Introduction
Prabu D
 
ruby_vs_perl_and_python
ruby_vs_perl_and_pythonruby_vs_perl_and_python
ruby_vs_perl_and_python
tutorialsruby
 

Mais procurados (19)

Workin ontherailsroad
Workin ontherailsroadWorkin ontherailsroad
Workin ontherailsroad
 
Ruby Presentation
Ruby Presentation Ruby Presentation
Ruby Presentation
 
Grooming with Groovy
Grooming with GroovyGrooming with Groovy
Grooming with Groovy
 
Ruby Programming Introduction
Ruby Programming IntroductionRuby Programming Introduction
Ruby Programming Introduction
 
Ruby An Introduction
Ruby An IntroductionRuby An Introduction
Ruby An Introduction
 
Natural Language Processing in Ruby
Natural Language Processing in RubyNatural Language Processing in Ruby
Natural Language Processing in Ruby
 
Introduction to Hanjp-IM Project (DebConf18 - Hsinchu, Taiwan)
Introduction to Hanjp-IM Project (DebConf18 - Hsinchu, Taiwan)Introduction to Hanjp-IM Project (DebConf18 - Hsinchu, Taiwan)
Introduction to Hanjp-IM Project (DebConf18 - Hsinchu, Taiwan)
 
Ruby Presentation - Beamer
Ruby Presentation - BeamerRuby Presentation - Beamer
Ruby Presentation - Beamer
 
Better problem solving through scripting: How to think through your #eprdctn ...
Better problem solving through scripting: How to think through your #eprdctn ...Better problem solving through scripting: How to think through your #eprdctn ...
Better problem solving through scripting: How to think through your #eprdctn ...
 
Exploring Natural Language Processing in Ruby
Exploring Natural Language Processing in RubyExploring Natural Language Processing in Ruby
Exploring Natural Language Processing in Ruby
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Dart programming language
Dart programming languageDart programming language
Dart programming language
 
Lambda The Extreme: Test-Driving a Functional Language
Lambda The Extreme: Test-Driving a Functional LanguageLambda The Extreme: Test-Driving a Functional Language
Lambda The Extreme: Test-Driving a Functional Language
 
Ruby Introduction
Ruby IntroductionRuby Introduction
Ruby Introduction
 
Writing Readable Code
Writing Readable CodeWriting Readable Code
Writing Readable Code
 
PHP, PHP Developer, Hire PHP Developer, PHP Web Development, Hire PHP Program...
PHP, PHP Developer, Hire PHP Developer, PHP Web Development, Hire PHP Program...PHP, PHP Developer, Hire PHP Developer, PHP Web Development, Hire PHP Program...
PHP, PHP Developer, Hire PHP Developer, PHP Web Development, Hire PHP Program...
 
Dart ppt
Dart pptDart ppt
Dart ppt
 
Go programing language
Go programing languageGo programing language
Go programing language
 
ruby_vs_perl_and_python
ruby_vs_perl_and_pythonruby_vs_perl_and_python
ruby_vs_perl_and_python
 

Destaque (6)

Introduction to Ruby
Introduction to RubyIntroduction to Ruby
Introduction to Ruby
 
Ruby Basics
Ruby BasicsRuby Basics
Ruby Basics
 
Lemme tell ya 'bout Ruby
Lemme tell ya 'bout RubyLemme tell ya 'bout Ruby
Lemme tell ya 'bout Ruby
 
Ruby data types and objects
Ruby   data types and objectsRuby   data types and objects
Ruby data types and objects
 
Память руби изнутри
Память руби изнутриПамять руби изнутри
Память руби изнутри
 
Ruby Data Types and Data Structures
Ruby Data Types and Data StructuresRuby Data Types and Data Structures
Ruby Data Types and Data Structures
 

Semelhante a Why Ruby

Specification Of The Programming Language Of Java
Specification Of The Programming Language Of JavaSpecification Of The Programming Language Of Java
Specification Of The Programming Language Of Java
Kim Moore
 
Computer Science Is The Study Of Principals And How The...
Computer Science Is The Study Of Principals And How The...Computer Science Is The Study Of Principals And How The...
Computer Science Is The Study Of Principals And How The...
Laura Martin
 
Stream SQL eventflow visual programming for real programmers presentation
Stream SQL eventflow visual programming for real programmers presentationStream SQL eventflow visual programming for real programmers presentation
Stream SQL eventflow visual programming for real programmers presentation
streambase
 

Semelhante a Why Ruby (20)

The Ring programming language version 1.9 book - Part 97 of 210
The Ring programming language version 1.9 book - Part 97 of 210The Ring programming language version 1.9 book - Part 97 of 210
The Ring programming language version 1.9 book - Part 97 of 210
 
The Ring programming language version 1.5.1 book - Part 173 of 180
The Ring programming language version 1.5.1 book - Part 173 of 180 The Ring programming language version 1.5.1 book - Part 173 of 180
The Ring programming language version 1.5.1 book - Part 173 of 180
 
The Ring programming language version 1.3 book - Part 81 of 88
The Ring programming language version 1.3 book - Part 81 of 88The Ring programming language version 1.3 book - Part 81 of 88
The Ring programming language version 1.3 book - Part 81 of 88
 
The Ring programming language version 1.10 book - Part 99 of 212
The Ring programming language version 1.10 book - Part 99 of 212The Ring programming language version 1.10 book - Part 99 of 212
The Ring programming language version 1.10 book - Part 99 of 212
 
Java And Community Support
Java And Community SupportJava And Community Support
Java And Community Support
 
pdx893ff61f-1fb8-4e15-a379-775dfdbcee77-7-14-26-112
pdx893ff61f-1fb8-4e15-a379-775dfdbcee77-7-14-26-112pdx893ff61f-1fb8-4e15-a379-775dfdbcee77-7-14-26-112
pdx893ff61f-1fb8-4e15-a379-775dfdbcee77-7-14-26-112
 
Learning to code in 2020
Learning to code in 2020Learning to code in 2020
Learning to code in 2020
 
The Ring programming language version 1.5.3 book - Part 186 of 194
The Ring programming language version 1.5.3 book - Part 186 of 194The Ring programming language version 1.5.3 book - Part 186 of 194
The Ring programming language version 1.5.3 book - Part 186 of 194
 
Specification Of The Programming Language Of Java
Specification Of The Programming Language Of JavaSpecification Of The Programming Language Of Java
Specification Of The Programming Language Of Java
 
The Ring programming language version 1.2 book - Part 77 of 84
The Ring programming language version 1.2 book - Part 77 of 84The Ring programming language version 1.2 book - Part 77 of 84
The Ring programming language version 1.2 book - Part 77 of 84
 
Computer Programming
Computer ProgrammingComputer Programming
Computer Programming
 
alex presentation (1).pptx
alex presentation (1).pptxalex presentation (1).pptx
alex presentation (1).pptx
 
Agile development with Ruby
Agile development with RubyAgile development with Ruby
Agile development with Ruby
 
notes on Programming fundamentals
notes on Programming fundamentals notes on Programming fundamentals
notes on Programming fundamentals
 
Computer Science Is The Study Of Principals And How The...
Computer Science Is The Study Of Principals And How The...Computer Science Is The Study Of Principals And How The...
Computer Science Is The Study Of Principals And How The...
 
Intro1
Intro1Intro1
Intro1
 
Go fundamentals
Go fundamentalsGo fundamentals
Go fundamentals
 
Stream SQL eventflow visual programming for real programmers presentation
Stream SQL eventflow visual programming for real programmers presentationStream SQL eventflow visual programming for real programmers presentation
Stream SQL eventflow visual programming for real programmers presentation
 
What Is Coding And Why Should You Learn It?
What Is Coding And Why Should You Learn It?What Is Coding And Why Should You Learn It?
What Is Coding And Why Should You Learn It?
 
Proglangauage1.10.18
Proglangauage1.10.18Proglangauage1.10.18
Proglangauage1.10.18
 

Mais de Daniel Lv (11)

Javascript framework and backbone
Javascript framework and backboneJavascript framework and backbone
Javascript framework and backbone
 
Intridea & open source
Intridea & open sourceIntridea & open source
Intridea & open source
 
Getting start with titanium
Getting start with titaniumGetting start with titanium
Getting start with titanium
 
Better framework, better life
Better framework, better lifeBetter framework, better life
Better framework, better life
 
上海的Rails社区
上海的Rails社区上海的Rails社区
上海的Rails社区
 
Kungfurails2009
Kungfurails2009Kungfurails2009
Kungfurails2009
 
Sinatra
SinatraSinatra
Sinatra
 
Contributing To Rails By Plugin Gem
Contributing To Rails By Plugin GemContributing To Rails By Plugin Gem
Contributing To Rails By Plugin Gem
 
J Ruby Kungfu Rails
J Ruby   Kungfu RailsJ Ruby   Kungfu Rails
J Ruby Kungfu Rails
 
Active Direct
Active DirectActive Direct
Active Direct
 
岛根县政府的挑战
岛根县政府的挑战岛根县政府的挑战
岛根县政府的挑战
 

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Último (20)

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 

Why Ruby