Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
A Hands-On Introduction to Ruby
Search
Zach Latta
July 27, 2013
Programming
980
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
Transcript
31 slides
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
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
650
Introduction to the Command-Line
zach
0
150
Other Decks in Programming
See All in Programming
Claude Code ハーネスDeep Dive – 君はどこまで制御する? -
takateeen_knj
6
6.2k
手の動かし方がわからなかった私が個人開発者になるまで
usagi0920_pochi
0
330
Spec-Driven Development - Why Vaadin Is the Perfect Fit
simas
PRO
0
260
SFCで実現する病院・医療システムの動的組み立て式UI
koukimiura
1
190
Ruby から Emacs を操作したい
phigasui
0
380
선언형 햅틱 라이브러리 진동을 소개합니다
l2hyunwoo
1
330
AIがコードを書いてくれる時代、我々は何を確かめるのか
yosuke_furukawa
PRO
13
6.1k
まずはコードより業務と向き合う:テーブル解体のためにPdMを呼んだ話
sakawe_ee
0
270
Python Lambdaにおけるテストしやすい設計とAI支援の活用 / Designing Testable Python Lambda Functions with AI
kitano_yuichi
1
350
AIが実装を担う時代の「技術設計」と「チームマネジメント」
kamina_zzz
2
400
複数ドメインを一つのアプリに統合するFlutterの設計と運用_FlutterKaigi2026登壇資料(須永高弘)
takahirosunaga
0
200
学びを記事・スライド・Xへ高速展開する― AI-assisted Learning Loopで回すコンテンツ生成術
ochtum
0
220
Featured
See All Featured
Reality Check: Gamification 10 Years Later
codingconduct
0
2.4k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
540
Building Adaptive Systems
keathley
44
3.3k
Paper Plane (Part 1)
katiecoart
PRO
3
12k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.8k
Test your architecture with Archunit
thirion
2
2.5k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
500
Digital Ethics as a Driver of Design Innovation
axbom
PRO
2
550
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
2
2.2k
Navigating Weather and Climate Data
rabernat
0
600
Designing for humans not robots
tammielis
254
26k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
990