|
|
|
|
|
by __loam
881 days ago
|
|
Most so the book is meant to be taken as a rule of thumb. I personally think simple interface hiding deep functionality is a really good one. I was looking at the langchain codebase last year after having read the book and the point was struck home. Many of the functions in Langchain are one line wrappers of other functions. I try to think of functions as atomic units of knowledge. Very short functions are a good indicator that you're not organizing that knowledge effectively. When you have a simple interface with deep logic, you're encapsulating logic in a single place. This is very good for reducing the cognitive load of a developer. Shallow functions fragment that knowledge across multiple classes/functions/files. The developer needs to hold more of the world in their head to make sense of things. This increases complexity. Additionally, you can sort of intuit this by looking at very successful commercial products like Google Search, the iPhone, and ChatGPT. Search is a single text input. The iPhone is a screen with a very small number of buttons. Chatgpt has a simple chat interface. All of these systems are incredibly complex, but they're able to present a simple interface to the public to allow most people to leverage that complexity without having to think about it. Just my 2 cents. |
|
He gets a lot of other stuff right though. Love his writing on comments