|
|
|
|
|
by gkaemmer
2910 days ago
|
|
At the same time, I find that it's often hard to comprehend projects that are broken into too many little files. There's normally no guide on what pieces are where, so you don't know which order to read things. Makes it a little tougher to dive in. I just want to find the file that has the "meat", and I don't mind if that file is 1000+ lines long, especially if the code itself makes sense and is clear. |
|
But I’m advocating something much stronger than that: breaking them down into small modules each with a published interface.
You can see what all any given module depends on by looking at one set of imports at the top of one file.
Each of those has a github repo and a README, so it’s easy to find out what they do...
But most importantly, the architecture of such a library will be wholly different than what it would have been if developed as a monorepo.
My point is not really that this structure of code is ergonomic. It’s that forcing yourself to do things this way forces you to clarify the purpose of modules. And to discover interfaces which are truly orthogonal.
And that makes the code easier to understand.