Zero Dependency Open Source

mustafaturan

Mustafa Turan

Posted on May 2, 2019

Zero Dependency Open Source

Writing a zero-dependency open-source library could be the way to bring an immortal contribution to the developer communities. Adding dependencies to your open-source will bring many update/upgrade work while your busy life goes on. And you/community may give-up one day to update those dependencies because of several reasons. Even the zero-dependency library might need language version updates. So, the real intention is keeping as minimum dependency as possible.


Instead of putting dependencies, put interfaces to the library and let the library users to use their own choice of libraries by implementing your interface. And share sample implementations with a dependent library as an example instead of directly adding implementation. (What is being defined is also a part of hexagonal-architecture pattern for software design which makes the library optioned without implementation choices.)

4 steps to provide zero-dependency library:

  1. Implement your library functionality
  2. When you need an external dependency(external library from another author), create an interface instead of adding the dependency
  3. Document a sample implementation with/without dependency (but do not implement)
  4. Let the library user decide what to use & leave the interface implementation to the library user.

This could be the way to bring an immortal contribution to the developer communities. Since there will be no dependency, the library can be used for new projects/libraries with different implementation details. Even after years, new implementations would be possible without updating the library...

Before taking action, it is highly recommended also reading DHH's Rails is Omakase post. More ideas are highly welcome. Let's discuss.

๐Ÿ’– ๐Ÿ’ช ๐Ÿ™… ๐Ÿšฉ
mustafaturan
Mustafa Turan

Posted on May 2, 2019

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

We reach 750+ Stars on our Repository!
Linux, I Choose You! ๐Ÿง
linux Linux, I Choose You! ๐Ÿง

September 25, 2024

Show us your open-source Project
discuss Show us your open-source Project

October 23, 2024

What are you guys building?
discuss What are you guys building?

August 22, 2024

ยฉ TheLazy.dev

About