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
Iskander (Alex) Sharipov
April 25, 2020
Programming
320
0
Share
How to design a library
Богдан Сторожук.
Iskander (Alex) Sharipov
April 25, 2020
More Decks by Iskander (Alex) Sharipov
See All by Iskander (Alex) Sharipov
quasigo
quasilyte
0
100
Go gamedev: XM music
quasilyte
0
150
Zero alloc pathfinding
quasilyte
0
730
Mycelium
quasilyte
0
97
Roboden game pitch
quasilyte
0
290
Ebitengine Ecosystem Overview
quasilyte
1
990
Go gamedev patterns
quasilyte
0
530
profile-guided code analysis
quasilyte
0
390
Go inlining
quasilyte
0
160
Other Decks in Programming
See All in Programming
次世代リンターで探る、tsgo 時代における型認識カスタムルールの現実解
ytakahashii
3
1.2k
開発とはなにか、Essenceカーネルで見えるもの
ukin0k0
0
220
tsserverとは何だったのか、これからどうなるのか
nowaki28
1
410
Talking to terminals (and how they talk back) (KotlinConf 2026)
jakewharton
PRO
1
150
バックエンドにElysiaJSを採用して気付いた、良い点・悪い点
wanko_it
1
190
GitHub Copilot CLIのいいところ
htkym
2
1.2k
Sans tests, vos agents ne sont pas fiables
nabondance
0
170
AI駆動開発勉強会 広島支部 第一回勉強会 AI駆動開発概要とワークショップ
hayatoshimiu
0
400
AIとRubyの静的型付け
ukin0k0
0
340
TSKaigi 2026 TypeScriptバックエンドのオブザーバビリティ戦略 — Datadog × NestJSの実践
taiseiyamamotoan
1
200
Zod v4 Codec でスキーマに型変換を埋め込む REST API 設計 #TSKaigi2026
ryutaro_yako
0
160
RTSPクライアントを自作してみた話
simotin13
0
300
Featured
See All Featured
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.5k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
820
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.3k
エンジニアに許された特別な時間の終わり
watany
107
240k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Typedesign – Prime Four
hannesfritz
42
3.1k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
190
Java REST API Framework Comparison - PWX 2021
mraible
34
9.3k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
300
Building AI with AI
inesmontani
PRO
1
1k
Speed Design
sergeychernyshev
33
1.7k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
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