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

Thoughs on Ruby libraries design

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers.

Thoughs on Ruby libraries design

Avatar for Vasily Kolesnikov

Vasily Kolesnikov

February 26, 2019
Tweet

Other Decks in Programming

Transcript

  1. Library • Fulfils its purpose • No negative effects on

    the target code • (Optional) Simple and extendable code 2
  2. • Libraries may conflict with other parts of your code

    • Clash top-level constant names • Incompatible versions of mutual dependencies • Change the target code process behaviour Negative effects 3
  3. • Versioning is important: • Change-logs • Semantic versioning •

    Back-porting • Optimistic vs. Pessimistic version lock Dependencies 7
  4. 13

  5. 14

  6. 15

  7. 16

  8. 20

  9. 26

  10. 27

  11. 28

  12. 29

  13. Consider harmful • Extra dependencies • Out of scope work

    (configuration of 3-rd libs) • Process modification (at_exit, signal traps) • Singleton and/or global (class level) configuration • Monkey patches • Common names of top-level modules 30