3 ms·
The problem is even bigger when you are reviewing PRs, the lack of context is the big problem,imo.
by jmrobles 4y ago
The problem is even bigger when you are reviewing PRs, the lack of context is the big problem,imo.
- KMag 4y agoI agree. Good code design, regardless of paradigm used, encapsulates complexity in order to minimize the amount of context needed to understand any one bit of code. The better the encapsulation, the better we can scale our limited mental capacity to larger and more complex systems. If the complexity is better encapsulated, it's also faster and easier for the reviewer to acquire the necessary context. When I was first learning OOP, I wish someone had mentioned why classes are useful: they leverage our natural mental abstraction machinery for understanding the world. Walking down the road, we generally think of each car as a whole and ignore thinking about the thousands of parts that make it up. It would be overwhelming to simply cross a busy street if we were considering all of the millions of car components flowing down the streets or considering the various differences in cars all the time, rather than abstractly thinking of various differing collections of parts as just "car". All of this happens at a subconscious level, and we can consciously tap into some of this mental machinery to help us reason about code. Of course, we don't need OOP to leverage this mental machinery, but it's one technique for doing so.