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
Thoughs on Ruby libraries design
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Vasily Kolesnikov
February 26, 2019
Programming
2
41
Thoughs on Ruby libraries design
Vasily Kolesnikov
February 26, 2019
Tweet
Share
Other Decks in Programming
See All in Programming
例外処理とどう使い分ける?Result型を使ったエラー設計 #burikaigi
kajitack
16
6k
CSC307 Lecture 05
javiergs
PRO
0
500
CSC307 Lecture 02
javiergs
PRO
1
780
AIによるイベントストーミング図からのコード生成 / AI-powered code generation from Event Storming diagrams
nrslib
2
1.9k
dchart: charts from deck markup
ajstarks
3
990
インターン生でもAuth0で認証基盤刷新が出来るのか
taku271
0
190
Rust 製のコードエディタ “Zed” を使ってみた
nearme_tech
PRO
0
160
AIと一緒にレガシーに向き合ってみた
nyafunta9858
0
200
CSC307 Lecture 04
javiergs
PRO
0
660
なぜSQLはAIぽく見えるのか/why does SQL look AI like
florets1
0
450
組織で育むオブザーバビリティ
ryota_hnk
0
170
Apache Iceberg V3 and migration to V3
tomtanaka
0
160
Featured
See All Featured
Testing 201, or: Great Expectations
jmmastey
46
8k
The Curse of the Amulet
leimatthew05
1
8.4k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
2.1k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
9.5k
Site-Speed That Sticks
csswizardry
13
1.1k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
1.6k
Mind Mapping
helmedeiros
PRO
0
79
Building the Perfect Custom Keyboard
takai
2
680
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
160
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
110
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.6k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
Transcript
Thoughts on Ruby libraries design 1
Library • Fulfils its purpose • No negative effects on
the target code • (Optional) Simple and extendable code 2
• Libraries may conflict with other parts of your code
• Clash top-level constant names • Incompatible versions of mutual dependencies • Change the target code process behaviour Negative effects 3
Dependencies 4
Dependencies 5
Version locking 6
• Versioning is important: • Change-logs • Semantic versioning •
Back-porting • Optimistic vs. Pessimistic version lock Dependencies 7
Top-level constants 8
Integration 9
Faraday::Typheus 10
Faraday::Typheus 11
Faraday::Typheus 12
13
14
15
16
Ran for 2 hrs 3 min 3sec. Total time 10
hrs 16 min 5 sec 17
Environment variables • The process attribute • Should not be
used inside a library code directly 18
Environment variables 19
20
Example: Redis 21
Example: Redis 22
Optional dependency 23
Core extensions 24
vs. Core extensions 25
26
27
28
29
Consider harmful • Extra dependencies • Out of scope work
(configuration of 3-rd libs) • Process modification (at_exit, signal traps) • Singleton and/or global (class level) configuration • Monkey patches • Common names of top-level modules 30
Thanks! 31
[email protected]
Moscow 2019