{"id":1082,"date":"2011-08-22T17:00:53","date_gmt":"2011-08-22T15:00:53","guid":{"rendered":"http:\/\/blog.eweibel.net\/?p=1082"},"modified":"2011-08-22T15:14:25","modified_gmt":"2011-08-22T13:14:25","slug":"branch-or-not-to-branch","status":"publish","type":"post","link":"https:\/\/blog.eweibel.net\/?p=1082","title":{"rendered":"Branch or not to branch"},"content":{"rendered":"<p><a href=\"http:\/\/blog.eweibel.net\/wp-content\/uploads\/Fotolia_25836922_S.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px 0px 0px 5px; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top: 0px; border-right: 0px; padding-top: 0px\" title=\"Fotolia_25836922_S\" border=\"0\" alt=\"Fotolia_25836922_S\" align=\"right\" src=\"http:\/\/blog.eweibel.net\/wp-content\/uploads\/Fotolia_25836922_S_thumb.jpg\" width=\"315\" height=\"212\" \/><\/a>That is a question? Yes, it is a question which you should ask yourself before to create a new branch or reuse an existing branch. There are other practices or possibilities to create new features in an existing software, which I will show in this blog post. Also there are some issues with branches and modern software engineering practices, which I will discuss here too.<\/p>\n<p>First I show you two techniques how to avoid branches: <a href=\"http:\/\/paulhammant.com\/blog\/branch_by_abstraction.html\" target=\"_blank\">Branch by abstraction (BBA)<\/a> and <a href=\"http:\/\/martinfowler.com\/bliki\/FeatureToggle.html\" target=\"_blank\">Feature toggle<\/a>.<\/p>\n<p><strong>Branch by abstraction<\/strong><\/p>\n<p>If you never heard of branch by abstraction it doesn\u2019t mean implicitly that you have never done it before. It is a quite simple approach: First create an abstraction of the existing code which you want to change (or refactor). Then create a new implementation of the abstraction. After you created the new implementation, declare the old implementation as obsolete (or deprecated). After a while you can delete the old implementation and maybe you could even remove the abstraction. All this actions happen in the main branch (or trunk). There is no need to create a new branch for that.<\/p>\n<p>It sounds quite easy and you don\u2019t loose the features of the continuous integration. But there are some issues with this technique: It isn\u2019t always possible to introduce an abstraction after a released version. And it isn\u2019t very beautiful to deploy duplicate behaviour to your customers when they should know yet the new implementation. <\/p>\n<p><strong>Feature toggle<\/strong><\/p>\n<p>Another technique to avoid the creation of a branch are feature toggles. You create the new feature in your main branch (or trunk), but you disable the feature by a toggle in your configuration file until the feature is ready to use. Maybe you have even a database driven menu management system or a complex user right management system in your application. If so, then you maybe use already feature toggles. <\/p>\n<p>Also this technique has the same issue as the branch by abstraction approach: During you develop the feature and you have to deploy new versions of your software, you will also deploy the current unfinished version of your new feature. Only the toggle prevents that the customer see your unfinished feature. So it is important, that the customer can\u2019t manage those toggles.<\/p>\n<p><strong>Isolate as little as possible<\/strong><\/p>\n<p>Branch by abstraction and feature toggle are techniques which help you to avoid creating branches for little and fast changes or adding new little features. But if you aren\u2019t sure if you\u2019ll brake something or adding side-effects then a new feature branch would be the better solution.<\/p>\n<p>The argument that you have to create a feature branch because you couldn\u2019t be sure that you can do all the work until the release deadline, is not always a good reason to create a new branch. Ask yourself why there is a time problem. If you have the possibility to improve the process with the project&#160; manager or with the product owner, then try to refine the features, optimize the task assignments in the team to deliver a feature until the deadline.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>That is a question? Yes, it is a question which you should ask yourself before to create a new branch or reuse an existing branch. There are other practices or possibilities to create new features in an existing software, which I will show in this blog post. Also there are some issues with branches and modern software engineering practices, which I will discuss here too. First I show you two techniques how to avoid branches: Branch by abstraction (BBA) and&#8230;<\/p>\n<p class=\"read-more\"><a class=\"btn btn-default\" href=\"https:\/\/blog.eweibel.net\/?p=1082\"> Read More<span class=\"screen-reader-text\">  Read More<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[5,14],"tags":[],"class_list":["post-1082","post","type-post","status-publish","format-standard","hentry","category-good-practices","category-software-engineering"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/plOV9-hs","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":622,"url":"https:\/\/blog.eweibel.net\/?p=622","url_meta":{"origin":1082,"position":0},"title":"Branching practices","author":"Patrick","date":"6. Apr 2010","format":false,"excerpt":"In an environment where several developers work at the same code base or several features have to be implemented, then branching will be a topic. I was asked to create a branching guide for my current employer which use TFS as source code repository. Motivation In our projects I found\u2026","rel":"","context":"In &quot;Good practices&quot;","block_context":{"text":"Good practices","link":"https:\/\/blog.eweibel.net\/?cat=5"},"img":{"alt_text":"image","src":"https:\/\/i0.wp.com\/blog.eweibel.net\/wp-content\/uploads\/image_thumb3.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/blog.eweibel.net\/wp-content\/uploads\/image_thumb3.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/blog.eweibel.net\/wp-content\/uploads\/image_thumb3.png?resize=525%2C300 1.5x"},"classes":[]},{"id":1154,"url":"https:\/\/blog.eweibel.net\/?p=1154","url_meta":{"origin":1082,"position":1},"title":"TF.exe or maybe the most useful tool for TFS","author":"Patrick","date":"31. Jan 2012","format":false,"excerpt":"When you've to use TFS, then there are moments when you're missing some features in the UI tools in Visual Studio. In those situations the console tool tf.exe is very useful. In this short blog post I summarized the commands I used the most. Update an old version of a\u2026","rel":"","context":"In &quot;.NET&quot;","block_context":{"text":".NET","link":"https:\/\/blog.eweibel.net\/?cat=13"},"img":{"alt_text":"visualstudio","src":"https:\/\/i0.wp.com\/blog.eweibel.net\/wp-content\/uploads\/visualstudio_thumb.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1121,"url":"https:\/\/blog.eweibel.net\/?p=1121","url_meta":{"origin":1082,"position":2},"title":"Speaking at the .NET Usergroup Bern","author":"Patrick","date":"4. Dec 2011","format":false,"excerpt":"During a Lunch event organized by the .NET Usergroup Bern at the 7 December 2011 in Bern I will speak about the following question: Is Software design overrated? Yes, I know, it's provocative. And obviously wrong. Really? I'm not so sure. After 10 years as software engineer and some years\u2026","rel":"","context":"In &quot;Design patterns&quot;","block_context":{"text":"Design patterns","link":"https:\/\/blog.eweibel.net\/?cat=3"},"img":{"alt_text":"image","src":"https:\/\/i0.wp.com\/blog.eweibel.net\/wp-content\/uploads\/image_thumb18.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":489,"url":"https:\/\/blog.eweibel.net\/?p=489","url_meta":{"origin":1082,"position":3},"title":"Kaizen and Software Engineering","author":"Patrick","date":"27. Oct 2009","format":false,"excerpt":"Kaizen is a very interesting approach, also in the software industry. On Wikipedia you\u2019ll find the following description of Kaizen: Kaizen is a Japanese word adopted into English referring to a philosophy or practices focusing on continuous improvement in manufacturing activities, business activities in general, and even life in general,\u2026","rel":"","context":"In &quot;Agile&quot;","block_context":{"text":"Agile","link":"https:\/\/blog.eweibel.net\/?cat=17"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1117,"url":"https:\/\/blog.eweibel.net\/?p=1117","url_meta":{"origin":1082,"position":4},"title":"Speaking at the .NET Usergroup Zentralschweiz","author":"Patrick","date":"18. Nov 2011","format":false,"excerpt":"I'm holding at the .NET Usergroup Zentralschweiz a short talk about \"Know your warm-up\", see my last blog post. I'll explain what I developed exactly and how I train new employees with this warm-up. I will also demonstrate the sample application which a new employee develops from scratch. Come to\u2026","rel":"","context":"In &quot;Good practices&quot;","block_context":{"text":"Good practices","link":"https:\/\/blog.eweibel.net\/?cat=5"},"img":{"alt_text":"dotnetzentral","src":"https:\/\/i0.wp.com\/blog.eweibel.net\/wp-content\/uploads\/dotnetzentral_thumb.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1213,"url":"https:\/\/blog.eweibel.net\/?p=1213","url_meta":{"origin":1082,"position":5},"title":"Quality isn&rsquo;t a tool&ndash;You can&rsquo;t install it!","author":"Patrick","date":"20. Jun 2012","format":false,"excerpt":"Did you ask yourself why a team in an organization produces very good software quality and another team in the same organization just struggles to get things done and those things are in really bad quality? Interesting is also that for both teams exists the same rules (methologies, procedures, tools,\u2026","rel":"","context":"In &quot;Agile&quot;","block_context":{"text":"Agile","link":"https:\/\/blog.eweibel.net\/?cat=17"},"img":{"alt_text":"time, quality and money concept","src":"https:\/\/i0.wp.com\/blog.eweibel.net\/wp-content\/uploads\/Fotolia_36622856_S_thumb.jpg?resize=350%2C200","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/blog.eweibel.net\/index.php?rest_route=\/wp\/v2\/posts\/1082","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.eweibel.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.eweibel.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.eweibel.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.eweibel.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1082"}],"version-history":[{"count":2,"href":"https:\/\/blog.eweibel.net\/index.php?rest_route=\/wp\/v2\/posts\/1082\/revisions"}],"predecessor-version":[{"id":1084,"href":"https:\/\/blog.eweibel.net\/index.php?rest_route=\/wp\/v2\/posts\/1082\/revisions\/1084"}],"wp:attachment":[{"href":"https:\/\/blog.eweibel.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1082"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.eweibel.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1082"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.eweibel.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1082"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}