Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
A Hands-On Introduction to Ruby
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Zach Latta
July 27, 2013
Programming
970
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
A Hands-On Introduction to Ruby
A brief introduction to the wonderful world of Ruby.
Zach Latta
July 27, 2013
More Decks by Zach Latta
See All by Zach Latta
The Art of Code
zach
0
170
Start a Hack Club
zach
0
150
Curiosity, Education, And What We Can Do Better
zach
1
640
Introduction to the Command-Line
zach
0
140
Other Decks in Programming
See All in Programming
どこまでゆるくて許されるのか
tk3fftk
0
520
Claude Team Plan導入・ガイド
tk3fftk
0
220
作るコストが小さくなった時代 幸せに働くために改めて考えたいこと 〜エンジニアとして価値を出し続けるために注視している二分野〜
yuppeeng
0
120
Prismを使った型安全な暗号化_関数型まつり2026
_fhhmm
0
150
信頼性について考えてみる(SRE NEXT 2026 miniLT)
hayama17
0
200
全PRの83%がAIレビューだけでマージできるようになった開発組織はその後どうなったか
athug
0
270
鹿野さんに聞く!『TypeScriptコードレシピ集』で磨く実践力
tonkotsuboy_com
4
1.1k
ルールを書いて終わらせないハーネスエンジニアリング
yug1224
4
1.7k
act2-costs.pdf
sumedhbala
0
120
PHP初心者セッション2026 〜生成AIでは見えない裏側を知る:今だからLAMPを通して仕組みを学ぶ〜
kashioka
0
620
AI がコードを書く時代における新卒エンジニアの仕事風景 (2026) / New Graduate Engineers in the Era of AI Coding (2026)
sushichan044
0
230
任せる範囲はこう広がった / How the Scope of AI Delegation Has Expanded
nrslib
1
270
Featured
See All Featured
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.7k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
660
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
910
Building the Perfect Custom Keyboard
takai
2
820
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.7k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.3k
Abbi's Birthday
coloredviolet
3
8.7k
Building AI with AI
inesmontani
PRO
1
1.1k
Evolving SEO for Evolving Search Engines
ryanjones
0
240
Prompt Engineering for Job Search
mfonobong
0
380
The Language of Interfaces
destraynor
162
27k
Transcript
RUBY zach latta a hands-on introduction to
ruby is a high productivity scripting language
Japan made in designed by matsumoto yukihiro
matz
None
None
None
None
...and many more
it’s fun idiomatic poignant not java
objects. objects everywhere.
1 "DO NOT USE ALL CAPS".downcase => "do not use
all caps" valid ruby 2 5.rationalize => (5/1)
i can’t believe it’s not english!
1 5.times { print "hi" } => "hihihihihi" print “hi”
five times 2 print "hi" * 5 => "hihihihihi"
1 import java.io.* 2 3 public class Hi 4 {
5 public static void main(String[] args) 6 { 7 for (int i = 0; i < 5; i++) 8 { 9 System.out.print("hi"); 10 } 11 } 12 } …and in java
quickly and easily understand other ruby
1 print 'This is not a '\ 'palindrome'.reverse => "emordnilap
a ton si sihT"
“code so beautiful that tears are shed” - why’s poignant
guide to ruby
1 puts "What is your name?" 2 name = gets.strip!
3 4 puts "Hello #{ name }. How are you?" greetings
! 1 import java.util.Scanner; 2 3 public class ALessNiceGreeting 4
{ 5 public static void main(String[] args) 6 { 7 Scanner scanner = new Scanner(System.in); 8 9 System.out.println("What is your name?"); 10 String name = scanner.nextLine().trim(); 11 12 System.out.println("Hi " + name + ". How are you?"); 13 14 scanner.close(); 15 } 16 } greetings (cont.)
1 contents = File.read('file.txt') 2 puts contents file io
1 import java.io.BufferedReader; 2 import java.io.FileReader; 3 import java.io.IOException; 4
5 public class BufferedReaderExample 6 { 7 public static void main(String[] args) 8 { 9 BufferedReader br = null; 10 11 try 12 { 13 14 String sCurrentLine; 15 16 br = new BufferedReader(new FileReader("file.txt")); 17 18 while ((sCurrentLine = br.readLine()) != null) 19 { 20 System.out.println(sCurrentLine); 21 } 22 23 } 24 catch (IOException e) 25 { 26 e.printStackTrace(); 27 } 28 finally 29 { 30 try 31 { 32 if (br != null)br.close(); 33 } 34 catch (IOException ex) 35 { 36 ex.printStackTrace(); 37 } 38 } 39 40 } 41 } file io (cont.)
power simplicity vs.
1 def a_method 2 puts "Hello world!" 3 end methods
1 get ‘/‘ do 2 'Hello world!' 3 end dsl
gems
bogosort while !sorted(deck) { shuffle(deck) }
bogosort best case: ΩΩ(n) worst case: Unbounded average case: O(n
× n!)
• http://mislav.uniqpath.com/ poignant-guide/ • http://tryruby.org • make something!
github.com/zachlatta/baas speakerdeck.com/zach/a- hands-on-introduction-to-ruby
[email protected]
e: w: zachlatta.com g: github.com/zachlatta