Complexity is anything that makes software hard to understand or to modify
Complexity is caused by obscurity and dependencies
Obscurity is when important information is not obvious
Dependency is when code can't be understood in isolation
Complexity is incremental, the result of thousands of choices. Which makes it hard to prevent and even harder to fix
Isolating complexity in places that are rarely interacted with is roughly equivalent to eliminating complexity.
Reduce the amount of code that is affected by each design decision, so design changes don't require very many code modifications.
When a design decision is used across multiple modules, coupling them together.
Modules are interface and implementation. The best modules are where interface is much simpler than implementation. It's more important for a module to have a simple interface than a simple implementation.
阮博士重点推荐了这本书: A Philosophy of Software Design
链接地址: http://www.ruanyifeng.com/blog/2018/09/complexity.html
金句