Upgrade to Pro — share decks privately, control downloads, hide ads and more …

How to design a library

How to design a library

Богдан Сторожук.

Iskander (Alex) Sharipov

April 25, 2020
Tweet

More Decks by Iskander (Alex) Sharipov

Other Decks in Programming

Transcript

  1. What we will talk about • Design your library API

    • Make it clear, effective, predictable and transparent
  2. What we will talk about • Design your library API

    • Make it clear, effective, predictable and transparent • Choose between alternative implementations
  3. What we will talk about • Design your library API

    • Make it clear, effective, predictable and transparent • Choose between alternative implementations • Assess your choices
  4. copy&paste friendliness • Meaningful method names • Zero configuration •

    Familiar patterns • Testability • No state management
  5. Pragmatism friendliness • Meaningful method names • Zero configuration •

    Familiar patterns • Testability • No state management
  6. Pragmatism friendliness • Meaningful method names • Zero configuration Reasonable

    defaults • Familiar patterns • Testability • No state management
  7. Pragmatism friendliness • Meaningful method names • Zero configuration Reasonable

    defaults • Familiar patterns • Testability Introspection • No state management
  8. Pragmatism friendliness • Meaningful method names • Zero configuration Reasonable

    defaults • Familiar patterns • Testability Introspection • No state management (by default)
  9. Expert friendliness • allocations controll • zero-cost abstractions • cost

    modelling • paradigm agnostics • multi-level API
  10. FIN