> Modularisation is usually the key. Small modules do one thing and are as seperated as much as possible with as little side effects as possible.
I think the key aspect is a bit different: understandability. That is, if you open two pages of random code, then can you roughly understand and follow what it roughly does?
Everything in a single package/module/directory can be quite understandable. It doesn't necessarily need to be modular, but it often does help. "Understandability" is more broad though, and also includes things such as not having weird hard to understand functions nested 8 levels deep, and things like that.
It also means not over-engineering things. "Our code is hard to understand, therefore, we need more architecture" is a fallacy I've seen a few times. The code wasn't hard to understand due to lack of modularity or architecture, but because it was just badly written unclear code.
"It also means not over-engineering things. "Our code is hard to understand, therefore, we need more architecture" is a fallacy I've seen a few times. The code wasn't hard to understand due to lack of modularity or architecture, but because it was just badly written unclear code."
For sure, if I have 10 tightly separated micro modules, just for the sake of it, then this is not helping clarity.
But if everything is an entangled mess of spaghetti code, then modularisation helps, so I do not have to look into 10 places to get what a certain function is doing.
I think the key aspect is a bit different: understandability. That is, if you open two pages of random code, then can you roughly understand and follow what it roughly does?
Everything in a single package/module/directory can be quite understandable. It doesn't necessarily need to be modular, but it often does help. "Understandability" is more broad though, and also includes things such as not having weird hard to understand functions nested 8 levels deep, and things like that.
It also means not over-engineering things. "Our code is hard to understand, therefore, we need more architecture" is a fallacy I've seen a few times. The code wasn't hard to understand due to lack of modularity or architecture, but because it was just badly written unclear code.