Writing code is about solving problems. These can be high-level problems, such as “We need a feature to allow users to share photos,” all the way down to low-level problems such as “We need some code to add two numbers together.” Even if we’re not conscious of the fact we’re doing it, when we solve a high-level problem, we usually do it by breaking it down into multiple, smaller subproblems. A problem statement such as “We need a system to allow users to share photos” might imply that we need to solve subproblems like storing photos, associating them with users, and displaying them.
How we solve problems and subproblems is important, but often just as important is how we structure the code that solves them. For example, should we just dump everything into one giant function or class, or should we try and break it out into multiple functions or classes? And if so, how should we do this?