These slides are from a short talk I gave at work for my coworkers and especially for our junior developers.
Overall, the slides are probably more of a conversation starter than they are useful in themselves.
How do you choose between using an existing library and coding it yourself? How do you evaluate whether someone else's code is good or not?
Whether it's RubyGems or React components or whatever, it seems like there's an existing solution to almost every problem.
Switching costs are very real and the bigger the surface area of the added dependency the greater the cost will be.
The first question to ask is whether to code it yourself or to add a 3rd party dependency.
Doing the work yourself will usually take more time but at the same time you maintain full control.
Once your know what's out there, you can evaluate the options…
- Is there good test coverage?
- Is the documentation good?
- Is it being used by others?
- Is it actively maintained?
- How much code is there?
- Read the code: does it look good?
If there's very little code, it might be better to just vendor or copy it into your project. Make sure to include the license and attribution details with the code.
Remember that the fastest and most reliable code is no code. No code also has the fewest bugs and security issues.
Obviously we need some amount of code to accomplish what we want to do, but the less code we use to reach our goals the better.
For an in-depth example, see The Cost Of JavaScript by Addy Osmani.
This doesn't mean that you should just give up on writing code or using libraries. It just means that you should be cognizant of the cost.
Above all, be aware of the cost of adding code.
When adding 3rd party code, evaluate its quality. Is the library production quality? Is it being used by other people? Is it being maintained?
Also, Ruby Toolbox has recently been revitalized. And of couse searching on GitHub is a good tool as well.