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
0
280
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
Go gamedev: XM music
quasilyte
0
64
Zero alloc pathfinding
quasilyte
0
350
Mycelium
quasilyte
0
34
Roboden game pitch
quasilyte
0
140
Ebitengine Ecosystem Overview
quasilyte
1
650
Go gamedev patterns
quasilyte
0
390
profile-guided code analysis
quasilyte
0
300
Go inlining
quasilyte
0
98
KPHP FFI
quasilyte
0
390
Other Decks in Programming
See All in Programming
CSC509 Lecture 09
javiergs
PRO
0
110
Generative AI Use Cases JP (略称:GenU)奮闘記
hideg
0
160
カスタムしながら理解するGraphQL Connection
yanagii
1
1.2k
PLoP 2024: The evolution of the microservice architecture pattern language
cer
PRO
0
1.7k
C#/.NETのこれまでのふりかえり
tomokusaba
1
160
約9000個の自動テストの 時間を50分->10分に短縮 Flakyテストを1%以下に抑えた話
hatsu38
23
11k
生成 AI を活用した toitta 切片分類機能の裏側 / Inside toitta's AI-Based Factoid Clustering
pokutuna
0
580
Dev ContainersとGitHub Codespacesの素敵な関係
ymd65536
1
130
色々なIaCツールを実際に触って比較してみる
iriikeita
0
270
Realtime API 入門
riofujimon
0
110
のびしろを広げる巻き込まれ力:偶然を活かすキャリアの作り方/oso2024
takahashiikki
1
410
2万ページのSSG運用における工夫と注意点 / Vue Fes Japan 2024
chinen
3
1.3k
Featured
See All Featured
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
167
49k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
7.9k
Build The Right Thing And Hit Your Dates
maggiecrowley
32
2.4k
Done Done
chrislema
181
16k
Product Roadmaps are Hard
iamctodd
PRO
48
10k
Why Our Code Smells
bkeepers
PRO
334
57k
Facilitating Awesome Meetings
lara
49
6k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2.1k
We Have a Design System, Now What?
morganepeng
50
7.2k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
664
120k
4 Signs Your Business is Dying
shpigford
180
21k
The Cult of Friendly URLs
andyhume
78
6k
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