Of course, a branched code base in the limit is similarly never merged which obviously is terrible as well. My main point is don't follow trends, instead simply do what what makes sense - that might mean feature toggles, branches or some combination. Stay awake, be creative and avoid dogmatism: sometimes things are better out than in, other times better in than out.
Are you saying that people in this thought experiment would go so crazy with feature toggles that they'd develop several different versions of the same feature, each with different toggles?
The most obvious being, it's a lot easier to see everything when it's in one place.
That, to me, is the difference between committing on a branch and merging back to trunk/main. A branch is just a way to record and share an idea. Merging back is saying with some confidence "this is something we should build on". Feature flags allow you to disentangle that social signal of "we should build on this" from "this works in production".
I'm not sure (and curious) about other ways of working that can fulfill the same collaborative social signaling function.
Advocates of methodology will often speak in absolute terms. Plus their way of doing thinks is sometimes presented as a big magical revelation. This article is actually not like that, it reads like a historical summary.
It’s of course good to sometimes think about other ways of doing things. But in the end the way you’re using version control should reflect your requirements and development practice and not the other way around.
We do 1 main branch plus tagging. That’s it. It’s simpler for us and it’s a motivator to write code that works _now_.
But if we ended up in feature flag hell we would probably reconsider or simply branch off. Just be pragmatic about it.
There are of course companies with predefined rules about these things. I can’t speak to that.
But hey, I am not arguing for feature flags. No, Sir, please no.
Why do you prefer not to work with feature flags? For context, the product I am working on (which is not very big) uses a simple development/production split to enable or disable features. Several people have recommended using feature flags, but since I have not previously worked on projects that utilized them, I want to learn more about the advantages and disadvantages from a developer's perspective.
- a merge process that happens on CI
- and that takes some time, running checks on the merge branch with main merged into it to effectively test what main will be
- and you want to make sure that there's no contention, so you finish one merge before testing the next
then you effectively have a merge lock in CI.
And that can lead to merge convoys where lots of merges to main line up and take a long time.
I have found benefits though to structuring your WIP in a way that it can be merged into the trunk with minimal risk of breaking existing stuff. This is a mindset change around favoring adding new modules / components / endpoints without clobbering working code, especially for larger projects where the code is going to come in over the course of many releases.
Maintenance releases are done by going back to the tag or branch for your current prod release, making a new release branch from it, and pulling in whichever commits are needed.