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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Iskander (Alex) Sharipov
April 25, 2020
Programming
320
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
760
Mycelium
quasilyte
0
100
Roboden game pitch
quasilyte
0
290
Ebitengine Ecosystem Overview
quasilyte
1
1k
Go gamedev patterns
quasilyte
0
540
profile-guided code analysis
quasilyte
0
390
Go inlining
quasilyte
0
170
Other Decks in Programming
See All in Programming
The ROI of Quarkus for Spring Boot Applications
hollycummins
0
140
LLMによるContent Moderationの本番運用の裏側と品質担保への挑戦
suikabar
3
780
軽量Java基盤の設計 DIコンテナに頼らない、長期保守と1秒起動の実現 JJUG CCC 2026 Spring
macha64
0
590
Spec Driven Development | AI Summit Lisbon
danielsogl
PRO
0
210
[2026年度第1回ORセミナー] 計画最適化ベンチャーと競技プログラミング人材
terryu16
0
270
Performance Engineering for Everyone
elenatanasoiu
0
230
Make SRE Operations Easier with Azure SRE Agent
kkamegawa
0
8.3k
Datadog × OpenTelemetry 入門と実践のあいだ
kn_to_maxpno
1
180
Go1.27で導入されるジェネリクスメソッドでできること
mackee
0
190
脅威をエンジニアリングの糧にして――現場編 / Turning Threats into Engineering Fuel — Field Edition
nrslib
0
300
生成AI時代にこそ効くGo | Why Go Works in the Age of Generative AI
mom0tomo
8
3.3k
dRuby over BLE
makicamel
2
390
Featured
See All Featured
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
540
Bash Introduction
62gerente
615
220k
First, design no harm
axbom
PRO
2
1.2k
Paper Plane
katiecoart
PRO
1
52k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
210
Why Our Code Smells
bkeepers
PRO
340
58k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
52k
Darren the Foodie - Storyboard
khoart
PRO
3
3.4k
Six Lessons from altMBA
skipperchong
29
4.3k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
260
Building the Perfect Custom Keyboard
takai
2
800
Facilitating Awesome Meetings
lara
57
7k
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