DEV Community

Discussion on: why branching on git is wrong

Collapse
 
andreidascalu profile image
Andrei Dascalu

Well, I think that your premise of finding an issue with feature branching fails due to the fact that it relies on a forced parallel that doesn't reflect a real world case. A product isn't a painting by any means, but even if it was split into pieces (features), you would need a method to do that in a way that will provide a nice partial painting at every step or in any mix of 'features'. Even so, splitting isn't done by piece and even in the beginning there would be a wire frame depicting the whole thing so any painter would be aware of what the others should have. Yes, there Wil be misalignments but not as bad as you'd think.
Also, using feature switching isn't the answer in the case that you started to illustrate. Eg, features that depend one on another. One feature can be switched but what do you do with multiple features? I need to have the case where 3 work together but not the 4th,or just 2 of them available while I have the code for 3rd but it's still have baked. I would need to keep a lot of technically useless code for stuff that product management might just decide to eventually scrap.
Also, feature branching main benefit isn't lack of conflict. There will always be conflicts against the main integration branch (master, develop or whatever). The more integration waits, the greater the risk.
The main benefit of feature branching is the ability to add features or simply scrap them without the need for extra work or risk of leaving garbage code around.