DEV Community

Discussion on: How to maintain a personal reusable code library

Collapse
 
rhymes profile image
rhymes

I had this issue recently because of a couple of modules I wanted to reuse. I thought about creating a shared repository in Github and then pull it from both projects but it was too much of a hassle. I ended up copying over the modules and their tests in the new project.

So my technique is still copy and paste. Keep in mind that they might evolve differently (and in the end they did) so creating a shared library for so little functionality wasn't worth it.

Creating a library might be worth it if you keep working with the same technology in different projects or with a team.

I would consider the mono repo architecture for shared code also.

Collapse
 
miionu profile image
Rospars Quentin

I understand your point and it is what I thought too. Creating and keeping a personal library up-to-date is too much work for what it's worth.

And about using the same technology, I have to find a way to mix different languages at the same place.

So what I did until know (but it can be time consuming), is to force myself to write a good external documentation for most of my projects, through private repo for example. And then search on them when I want to recreate something similar.
I'm saying this because sometimes find the class/method within the code can be tough.