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
Playing with Sorbet
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Luciano Sousa
September 12, 2019
Programming
55
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Playing with Sorbet
A short presentation about how Sorbet could help your project
Luciano Sousa
September 12, 2019
More Decks by Luciano Sousa
See All by Luciano Sousa
Knowing mina deploy
lucianosousa
1
82
Creating your startup without Developer
lucianosousa
0
180
Patterns Falacy v2
lucianosousa
0
130
Project Management like Software Developer
lucianosousa
1
120
The Patterns Falacy - Rails Version
lucianosousa
1
130
Sinatra::Ftw
lucianosousa
0
110
Other Decks in Programming
See All in Programming
Mujeres en SEO Summit 2026 - Greatest Disaster Hits en Web Performance
guaca
0
190
ADKを使って簡単にAIエージェントを作ってみよう
k1mu21
0
270
ふつうのFeature Flag実践入門
irof
8
4k
Language Server 使ってる? 〜VSCode と Zed の場合〜 / Are you using a Language Server? ~For VS Code and Zed~
handlename
0
790
C# and C++ Interoperability - cho-dotnetnew
harukasao
0
260
技術記事、 専門家としてのプログラマ、 言語化
mizchi
13
6.2k
Vue × Nuxt × Oxc どこまで使える?実運用の現在地
andpad
0
270
Observability in Practice:Grafana 與 Edge Device SRE 的那些事
blueswen
0
170
代数的データ型って何が嬉しいの? #frontend_phpcon_do
kajitack
8
3.7k
Lemonade + Foundry Toolkit でお手軽アプリ開発
seosoft
1
360
Agentic UI
manfredsteyer
PRO
0
180
技術的負債解消で開発者の未来を開く- AIの力でコード刷新
kmd2kmd
0
110
Featured
See All Featured
Automating Front-end Workflow
addyosmani
1370
210k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
210
Utilizing Notion as your number one productivity tool
mfonobong
4
320
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
430
Music & Morning Musume
bryan
47
7.2k
Thoughts on Productivity
jonyablonski
76
5.2k
Agile that works and the tools we love
rasmusluckow
331
21k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
71
40k
Abbi's Birthday
coloredviolet
2
8.1k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.8k
Building Applications with DynamoDB
mza
96
7.1k
Transcript
Playing with Sorbet
What
Sorbet is a fast, powerful type checker designed for Ruby.
Why
Once upon a time
We expose a public API
Expecting params = { user: { first_name: "Luciano", last_name: "Sousa"
} }
We got a
params = { user: "a" }
TypeError (no implicit conversion of Symbol into Integer)
None
NoMethodError (undefined method `where' for nil:NilClass)
Let’s talk about Java
None
Let’s talk about dynamic vs static typed languages
• •
• • •
String javaString = new String(“I am a Java string”) ruby_string
= “I am a Ruby string”
Dynamic languages
Ruby
Examples
begin do_something rescue StandardErro do_something_else end
Tests
Let's talk about Shopify
~1500 devs
~40 deploys/day
~5 million req/min
~83k req/sec ~170k req/sec peak
Sorbet at Shopify
~36 issues fixed
~17 dead code never hit
~16 name error
~3 wrong args
Maybe some millions
Examples
“I hate type annotations.”
class UserHelper def name_length(name) name.length end end
# typed: true class UserHelper def name_length(name) name.length end end
# typed: true class UserHelper extend T::Sig def name_length(name) name.length
end end
# typed: true class UserHelper extend T::Sig sig { params(name:
String).returns(Integer) } def name_length(name) name.length end end
How it works
Disclaimer
None
# typed: true
None
extend T::Sig
sig { params(name: String).returns(Integer) }
sig { params(name: String).returns(Integer) }
Resources •
Resources •
Resources •
Resources •
Thanks!