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
フィードバックで育てるAI開発
kotaminato
1
110
才能?センス?知らん、 続けたもん勝ちだ。-- 結婚・出産・癌を越えてなお、私がプロダクトを創り続ける理由
16bitidol
2
840
Honoでのサプライチェーン侵害対策 〜 3つのライブラリに学ぶ
yusukebe
7
1.8k
Hatena Engineer Seminar #37「言語モデルの活用に関する研究」
slashnephy
0
510
ローカルLLMでどこまでコードが書けるか -拡張版 / How much code can be written on a local LLM Extended
kishida
12
4.7k
任せる範囲はこう広がった / How the Scope of AI Delegation Has Expanded
nrslib
1
250
【やさしく解説 設計編・中級 #6】良いアーキテクチャとは ~ 一本の登り道の、行き先 ~
panda728
PRO
0
140
OS アップデート対応の取り組み方がもっと共有されてほしい
andpad
0
110
AI駆動開発を妨げる技術的負債の解消アプローチ / ai-refactoring-approach
minodriven
17
8.9k
地域 SRE コミュニティ最前線 - ホンマでっかSRE勉強会
tk3fftk
0
220
Even G2とAWSで推しのエージェントを召喚しよう!
har1101
1
160
技術記事、 専門家としてのプログラマ、 言語化
mizchi
14
7.4k
Featured
See All Featured
Test your architecture with Archunit
thirion
1
2.3k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.5k
New Earth Scene 8
popppiees
3
2.4k
Ethics towards AI in product and experience design
skipperchong
2
330
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
240
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.8k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
190
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.4k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
220
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.4k
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!