Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save danjwinter/821e637b7cc105da7722 to your computer and use it in GitHub Desktop.
Save danjwinter/821e637b7cc105da7722 to your computer and use it in GitHub Desktop.
The Dangers of Using Code You Don't Control

Checks for Understanding

  • In broad strokes, summarize the event

Kik wanted to create an NPM module named Kik for it's services. They sent a request to Koculu, maintainer of 250 NPM modules including one named Kik, to rename his module. Koculu refused. Kik went to NPM with their lawyers. NPM told Koculu to change it. Koculu pulled all his modules. Thousands of projects, including NPM, had a dependency on one of his modules, left-pad. They all broke. People cried. NPM retroactively restored it.

  • How do NPM and RubyGems relate?

They both manage code sets that developers can include in their projects. The former is for JavaScript, the latter Ruby.

  • What is left-pad and why is it used?

Left-pad is an NPM module that adds padding to the left of text. It's used so that developers don't need to write their own custom padding solution.

Observing

  • Gem 1 - Headshot

  • What does this Gem generally do?

    • Allows easy access to a user's webcam.
  • When is the date of the last commit?

    • May 4, 2015
  • How many open issues does it have? -2

  • Start looking around the source code

  • Does it seem reasonable to add this dependency into your code?

    • My flash needs a whole lot of work, so yes. But, now that I'm understanding more JavaScript, I think I can use HTML5's built in camera options in conjunction with JS to handle some of this myself.
  • Gem 2 - Shoulda-matchers

  • What does this Gem generally do?

    • Allows for easy testing of rails validations.
  • When is the date of the last commit?

    • February 25th, 2015
  • How many open issues does it have?

    • 56
  • Start looking around the source code

  • Does it seem reasonable to add this dependency into your code?

    • Yes, it seems well maintained and used by lots of developers. Hand-rolling these methods would consume lots of time, and far outweigh the risk unless the project was large and had special requirements.
  • Gem 3 - Pry

    • What does this Gem generally do?
      • IRB alternative and run-time console.
  • When is the date of the last commit?

    • February 26, 2016
  • How many open issues does it have?

    • 143
  • Start looking around the source code

  • Does it seem reasonable to add this dependency into your code?

    • Yes, it has been invaluable for troubleshooting
  • What are some factors you consider when adding dependencies to your projects? Honestly, it hasn't been a huge consideration thus far. Normally if it saves time or I'm not sure how to do it myself and it looks like it is being maintained regularly and used by a bunch of developers, I'll add it. I should probably reconsider that approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment