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
How to design a library
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Iskander (Alex) Sharipov
April 25, 2020
Programming
0
310
How to design a library
Богдан Сторожук.
Iskander (Alex) Sharipov
April 25, 2020
Tweet
Share
More Decks by Iskander (Alex) Sharipov
See All by Iskander (Alex) Sharipov
quasigo
quasilyte
0
89
Go gamedev: XM music
quasilyte
0
140
Zero alloc pathfinding
quasilyte
0
640
Mycelium
quasilyte
0
91
Roboden game pitch
quasilyte
0
260
Ebitengine Ecosystem Overview
quasilyte
1
940
Go gamedev patterns
quasilyte
0
510
profile-guided code analysis
quasilyte
0
380
Go inlining
quasilyte
0
140
Other Decks in Programming
See All in Programming
受け入れテスト駆動開発(ATDD)×AI駆動開発 AI時代のATDDの取り組み方を考える
kztakasaki
2
560
nuget-server - あなたが必要だったNuGetサーバー
kekyo
PRO
0
230
20260228_JAWS_Beginner_Kansai
takuyay0ne
5
490
AIコーディングの理想と現実 2026 | AI Coding: Expectations vs. Reality 2026
tomohisa
0
1.2k
ベクトル検索のフィルタを用いた機械学習モデルとの統合 / python-meetup-fukuoka-06-vector-attr
monochromegane
2
390
ふつうの Rubyist、ちいさなデバイス、大きな一年
bash0c7
0
830
encoding/json/v2のUnmarshalはこう変わった:内部実装で見る設計改善
kurakura0916
0
400
new(1.26) ← これすき / kamakura.go #8
utgwkk
0
2.2k
エージェント開発初心者の僕がエージェントを作った話と今後やりたいこと
thasu0123
0
240
今更考える「単一責任原則」 / Thinking about the Single Responsibility Principle
tooppoo
3
1.6k
AIコードレビューの導入・運用と AI駆動開発における「AI4QA」の取り組みについて
hagevvashi
0
430
Goの型安全性で実現する複数プロダクトの権限管理
ishikawa_pro
1
250
Featured
See All Featured
BBQ
matthewcrist
89
10k
Leo the Paperboy
mayatellez
4
1.5k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
68
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
150
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
160
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
270
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
250
How to Ace a Technical Interview
jacobian
281
24k
My Coaching Mixtape
mlcsv
0
69
Scaling GitHub
holman
464
140k
Transcript
How to please everyone
How to please everyone or random thoughts about library design
What we will talk about
What we will talk about • Design your library API
What we will talk about • Design your library API
• Make it clear, effective, predictable and transparent
What we will talk about • Design your library API
• Make it clear, effective, predictable and transparent • Choose between alternative implementations
What we will talk about • Design your library API
• Make it clear, effective, predictable and transparent • Choose between alternative implementations • Assess your choices
About me
About me
About me
About me
Disclaimer This talk is based on personal experience
Your users
Your users •Regular users
Your users •Regular users •Advanced users
Your users •Regular users •Advanced users •Experts
Your users •Regular users •Advanced users •Experts
Your users •Regular users •Advanced users •Experts
Your users •Regular users •Advanced users •Experts
Regular users
Regular users
Regular users
Regular users
None
None
Example
Example
Example github.com/storozhukBM/verifier
Example github.com/storozhukBM/verifier
copy&paste friendliness • Meaningful method names
copy&paste friendliness • Meaningful method names • Zero configuration
copy&paste friendliness • Meaningful method names • Zero configuration •
Familiar patterns
copy&paste friendliness • Meaningful method names • Zero configuration •
Familiar patterns • Testability
copy&paste friendliness • Meaningful method names • Zero configuration •
Familiar patterns • Testability • No state management
Examples github.com/pkg/errors
Examples github.com/robfig/cron
Examples github.com/robfig/cron
Examples github.com/robfig/cron
Examples github.com/robfig/cron
Examples github.com/robfig/cron
Advanced users
None
Advanced users
Pragmatism friendliness • Meaningful method names • Zero configuration •
Familiar patterns • Testability • No state management
Pragmatism friendliness • Meaningful method names • Zero configuration Reasonable
defaults • Familiar patterns • Testability • No state management
Pragmatism friendliness • Meaningful method names • Zero configuration Reasonable
defaults • Familiar patterns • Testability Introspection • No state management
Pragmatism friendliness • Meaningful method names • Zero configuration Reasonable
defaults • Familiar patterns • Testability Introspection • No state management (by default)
Optional configuration
Optional configuration github.com/tidwall/buntdb
Optional configuration github.com/tidwall/buntdb
Optional configuration github.com/valyala/fasthttp
Introspection
Introspection github.com/valyala/fasthttp
Introspection github.com/valyala/fasthttp
Introspection github.com/resilience4j/resilience4j
Introspection github.com/resilience4j/resilience4j
Introspection github.com/resilience4j/resilience4j
Introspection github.com/resilience4j/resilience4j
Introspection github.com/resilience4j/resilience4j
Experts
Experts
Experts
Expert friendliness • allocations controll
Expert friendliness • allocations controll • zero-cost abstractions
Expert friendliness • allocations controll • zero-cost abstractions • cost
modelling
Expert friendliness • allocations controll • zero-cost abstractions • cost
modelling • paradigm agnostics
Expert friendliness • allocations controll • zero-cost abstractions • cost
modelling • paradigm agnostics • multi-level API
Tools •Profiler
Tools •Profiler •Tracer
Tools •Profiler •Tracer •Throughput benchmarks
Tools •Profiler •Tracer •Throughput benchmarks •Latency benchmarks
Tools •Profiler •Tracer •Throughput benchmarks •Latency benchmarks •Allocations profiling
Allocations control github.com/storozhukBM/verifier
Allocations control github.com/storozhukBM/verifier
Allocations control github.com/storozhukBM/verifier
Allocations control github.com/storozhukBM/verifier
Zero-cost abstractions “not pay for what you don't use”
Zero-cost abstractions github.com/resilience4j/resilience4j
Zero-cost abstractions github.com/resilience4j/resilience4j
Cost modelling
None
None
None
None
Paradigm agnostics
Paradigm agnostics
Is it even possible? •Regular users •Advanced users •Experts
None
None
Multi-level API
Multi-level API
Multi-level API
Multi-level API
Multi-level API
One more thing
None
One more thing
Backward compatibility
API State Clear Stateless Predictable Transparent Effective Summary
FIN