News for hackers. Stuff that matters.
Re:Trunk-Based Development by einrealist on Sunday January 29, 2017 @01:17PM (#13515677)
With TBD you can reduce the overhead of coordination between committers.

Edit for clarification: "Branching in code", á la Feature Toggles is much better, because everything around it can be automated. With CVS branches, you shift that process into an earlier development stage where you need more human collaboration. So TBD can shift the focus of collaboration to things that matter more: the code.

Re:Trunk-Based Development by cygned on Sunday January 29, 2017 @02:51PM (#13516185)
I am very concerned that feature toggles add unnecessary complexity to the code.

With Lisp Macros, for example, that would actually be quite elegant but in a language like JavaScript, we'd end up with a bunch of if'a here and there, wouldn't we? One might simplify it a bit with a different architecture, though.

Re:Trunk-Based Development by sydd on Sunday January 29, 2017 @04:38PM (#13516854)
Long lived branches add complexity too, it's just hidden in GIT. The main issue with feature branches are merge conflicts: they are the most evil operation one can imagine. First you have your code, that you understand. Then you have others code that you have no idea what it does, so first you need to understand it. This might take hours when done properly. Usually people skim over this part BC it's boring. This leads to superficial merges that leads to very very evil and hard to find bugs. And these bugs are super hard to find in git logs, since the merge commit is 2 or more people's code.

Whereas the alternative, feature toggles are much better: first you don't need one for every small thing, add them to bigger features that take weeks to implement. With a team of ~10 developers you should not need more than 2 at one time (if you have more the management is at fault). Then feature toggles enforce modularity: by principle you should use them in as few places as possible, this will make the interface between the new feature and your current app as small as possible. This is a good thing!

Re:Trunk-Based Development by icebraining on Sunday January 29, 2017 @02:34PM (#13516099)
Why can't you automatically merge all the branches for testing? Sure, sometimes it won't cleanly merge, but then again, features behind toggles won't always work well together.
Re:Trunk-Based Development by qwer on Sunday January 29, 2017 @03:42PM (#13516502)
I once wished this were possible too, but in reality it isn't.

With n branches there are n! permutations to test. That's a lot of infrastructure to maintain and computing power to spend and you still don't end up with a single team-blessed deployment artifact that can automatically be promoted for manual testing or release.

Don't get me wrong, feature-toggles are indeed a pain in the ass, but in my experience cherry-picking branches to merge really is much much worse.

Re:Trunk-Based Development by icebraining on Sunday January 29, 2017 @07:35PM (#13517768)
And with n feature flags, aren't there also n! permutations to test, that is, each combination of enabled/disabled? If you say no, because you just test features as they get manually enabled, why can't you do the same by manually selecting branches to be merged?
Re:Trunk-Based Development by einrealist on Monday January 30, 2017 @05:04AM (#13519821)
Yes, that complexity does not go away. But you only need one delivery pipeline, with one test/staging environment. Toggling and running acceptance tests against the variations can be automated, but is viable when done manually.
Re:Trunk-Based Development by susam on Monday January 30, 2017 @05:20AM (#13519884)
With n feature flags, there are 2^n possibilities to test.