The creation of a new package
In any software, there will be snippets of code that could be shared across different parts of the code. When working with small, monolithic applications, this can be as easy as creating some internal modules or functions that can share functionality by calling it directly.
Over time, this common function or functions could be grouped together under a module to clarify that they are to be used across the application.
Avoid the temptation to use the name utils
for a module with code expected to be used in different positions. While this is very common, it is also not very descriptive and a bit lazy. How does someone know if a function is in the utils
module? Instead of that, try to use a descriptive name.
If it's not possible, divide it into submodules, so you can create something like utils.communication
or utils.math
to avoid this effect.
This will work fine up to a certain size. Some of the problems that can arise...