There are two obvious ways of sharing functionality between projects:
- Create a shared library
- Create a dedicated program and call that from another program
Dedicated programs
This is related to the Unix Philosophy (read more in 📝 Reading Notes - Basics of the Unix Philosophy):
Make each program do one thing well. To do a new job, build afresh rather than complicate old programs by adding new features.
The list of Unix tools indeed shows a large selection of tools with a very small responsibility that is supposed to be combined into more complex functionality.
This same mindset also comes back in the Microservice Architecture, although for microservices it comes from from a scaling and organisational point of view, but it coincidentally also leads to smaller programs with a single responsibility.