As an individual developer, I often find need to write a trivial (let's say, under 100 SLOC + tests + docs + build system config) library that helps me to write code of some other (large) project in a simpler and more readable way. The libraries are unrelated and often simply add some feature that was missed out in some library that I use.

Example: Imagine a programming language that does not provide one of my favourite string case conversions (let's say eAch fIrst to Each First) in its standard library. I write function for this specific case conversion. Since I need this algorithm in some larger open-source project, I must somehow provide the library. I basically have three options:

  • embed the case-conversion code directly in the large project,

  • create a library and publish it separately (let's say one repo hosted on GitLab), or

  • maintain a collection of libraries and publish them as a collection (grouped by, e.g., programming language, and having a single repo hosted on GitLab or my website).

Since the libraries will probably have exactly one version, I do not need any version control.

Which of the options should I choose? I like the second one, but the third one would produce less clutter in my repository list on the hosting site.

  • 4
    more information needed. how trivial are we talking? why isn't there already some other lib out there? are you reusing across projects? you dont need version control??!! lots of red flags in this question as it stands
    – Ewan
    Apr 8, 2023 at 16:51
  • 1
    You're planning on using this library in a larger open source project so if you aren't using any kind of version control then you should put that code directly into that project instead because future users and contributors to the project could have a very difficult time with a library that isn't version controlled if anything unexpected happens to it. (If I were a maintainer of the project I would very likely reject any PR which attempted to import an uncontrolled library - something like that is a serious threat to the long-term viability of the project) Apr 9, 2023 at 5:27
  • If there is only one version, why not just copy the source into the project? Perhaps with a note of what date and git commit you took it. Apr 9, 2023 at 5:33


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.