4 ms·
IMHO that's exactly the skill differentiator between experienced and skilled developers vs. the novices. The skilled developer is able to take a big/difficult/
by ensiferum 6y ago
IMHO that's exactly the skill differentiator between experienced and skilled developers vs. the novices.
The skilled developer is able to take a big/difficult/complex problem and break it down to small steps that translate to simple sub-problems and their solutions and map ideally nearly 1 to 1 in commits. How far you need to continue this recursive process of breaking things down depends on how big the problem is but basically you'd do it until your commits and steps are single cohesive steps. Certainly this might mean that you end up committing functionality that is not used at that point in time but will only be used by later commits. Some people might disagree with this approach and prefer to squash this but I find that this approach keeps things simpler.
For example if I'm working on adding a new feature X in my application I need to think about how to support that feature given the current components/APIs/classes/whatnot that I have in my system. Let's say that in order to implement X I need to add a new API functionality in components Z and W and then implement the new feature in a new component X.
High level this is already 3 steps. Maybe doing the actual changes for Z and W are still too large and further need to be broken down. Then there'd be more than 3 steps and subsequently also more commits.
Now often what I end up doing when I don't really quite know yet how to best go about implementing something I do all the changes at once and once it all works and I've found my way I spend a moment of reflecting what I actually did (and if there are indeed alternative ways). Once I decide to finalize the work I then go back to my changes and do the commits in steps using git chunks.
It's all about looking a head, working out mentally the roadmap in simple steps from current state to the next state and then taking those steps. I find that in my career learning this mental model and the ability to break things down has taken the longest.