{"id":243,"date":"2024-06-11T18:56:00","date_gmt":"2024-06-11T18:56:00","guid":{"rendered":"https:\/\/permutationcity.co.uk\/bp\/?p=243"},"modified":"2024-06-08T16:02:16","modified_gmt":"2024-06-08T16:02:16","slug":"is-source-control-overworked","status":"publish","type":"post","link":"https:\/\/permutationcity.co.uk\/bp\/2024\/06\/11\/is-source-control-overworked\/","title":{"rendered":"Is source control overworked?"},"content":{"rendered":"\n<p>I hope all of you out there are using source control.\nI&#8217;ve used a bunch of different systems over the years,\nmost recently <a href=\"https:\/\/en.wikipedia.org\/wiki\/Git\">git<\/a>.\nAny sort of source control is a massive step up from none at all.\nIt means you:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Have historic versions of your code.<\/li>\n\n\n\n<li>A backup of your latest version in case your machine dies.<\/li>\n\n\n\n<li>Can easily share your codebase with someone else.<\/li>\n<\/ul>\n\n\n\n<p>Does anyone else think that&#8217;s quite a lot for one system?\nAre all of these different roles really supporting each other?<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"source-control-as-backup\">Source control as backup<\/h2>\n\n\n\n<p>Machines don&#8217;t die that often but it does happen.\nMaybe the hard drive goes, maybe the motherboard is bricked by something.\nIt might be possible to recover data but that&#8217;s going to take, at the very least, time.\nHardware tends to be pretty reliable nowadays so I&#8217;d be more worried about something else.\nYour laptop might get stolen or left on a bus, you can&#8217;t rely on getting those back.\nYour machine might get hit with ransomware, do you really want to pay the hackers?\nSo, for all of those cases did you push your changes recently?<\/p>\n\n\n\n<p>I&#8217;m not going to tell you to remember to check in your changes regularly. I&#8217;m going to say you <em>shouldn&#8217;t have to<\/em>. Ideally everything you write should be safely stored away. If you&#8217;ve got an external drive, a network server or the cloud an ideal backup system would just make sure your code was stored safely. Maybe you loose a few minutes work if your machine goes boom but certainly not days or weeks just because you weren&#8217;t at a sensible checkin point.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"source-control-as-file-sharing\">Source control as file sharing<\/h2>\n\n\n\n<p>Back in the day people might have been using floppy disks and passing things around.\nNowadays everyone has access to the repository on some sort of server.\nThat might be in hosted in the corner of the office or it might be in the cloud somewhere.\nIn any case everyone has access to it and can get the mainline code.<\/p>\n\n\n\n<p>It&#8217;s a bit harder if you&#8217;re trying to develop with someone or get an opinion on some code.\nAssuming it&#8217;s more involved than a screen share then\nthat probably means checking things in and the other person getting the latest version.\nDid you want to check things in?\nIt doesn&#8217;t matter, that&#8217;s what you need to do in order to share your code.\nWhy can&#8217;t we just share our code directly?\nI&#8217;m sure it&#8217;s possible but that&#8217;s just not the way it is.\nWith the right setup I should be able to see your code.\nMaybe it would let me edit that code directly, maybe my own version, maybe that&#8217;s a choice.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"source-control-as-history\">Source control as history<\/h2>\n\n\n\n<p>This is the big one.\nSource control keep track of all the version of your code.\nWell, it keeps track of all the versions of your code that you check in.\nAs we&#8217;ve seen that&#8217;s a mixture of versions you wanted to keep,\nversions you didn&#8217;t want to loose right now and versions you wanted to share.\nStill, it&#8217;s amazingly useful.\nYou get to see what changed when.\nThere might even be useful comments explaining why it was changed.<\/p>\n\n\n\n<p>With git my standard procedure is to take the somewhat messy history that comes from everyday work and\nthen rework that to make it easier to understand.\nI put things in the best order, maybe squash several intermediate steps together.\nIt can be temperamental.\nIf something isn&#8217;t quite right then it has to be aborted and done again from the start.\nCommand line tools don&#8217;t feel like the right place to be doing this.\nI&#8217;ve actually been looking at graphical alternatives recently and the selection isn&#8217;t great.<\/p>\n\n\n\n<p>However this doesn&#8217;t give me all the history I&#8217;d like.\nThere have definitely been times when I haven&#8217;t checked things in that I regret later.\nIf you&#8217;re experimenting with a problem then do you check every single variation in?\nIf you do your history is completely cluttered.\nIf you don&#8217;t you might miss something later.\nWhat if it was more like an endless undo buffer which kept all the changes?\nEvery so often you&#8217;d tag one of those versions with a subject line and comment but\nall the bits in between would also be kept.\nNavigating that might be more challenging but worth it if, say,\nyou want to know why a special case was put in.\nBack in the day we might have worried about the amount of data that might make but\nspace is cheap nowadays and code diffs aren&#8217;t that big.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"in-the-end\">In the end<\/h2>\n\n\n\n<p>Source control is great but we&#8217;re asking it to do a lot of things and they aren&#8217;t really complementary. However we all get use to systems and then go about using them as well as we can. I&#8217;ve been using source control for a while but the fundamental ideas still seem to be the same. I don&#8217;t have a solution to this but it would be nice to see something new.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I hope all of you out there are using source control. I&#8217;ve used a bunch of different systems over the years, most recently git. Any sort of source control is a massive step up from none at all. It means you: Does anyone else think that&#8217;s quite a lot for one system? Are all of [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-243","post","type-post","status-publish","format-standard","hentry","category-general"],"_links":{"self":[{"href":"https:\/\/permutationcity.co.uk\/bp\/wp-json\/wp\/v2\/posts\/243","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/permutationcity.co.uk\/bp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/permutationcity.co.uk\/bp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/permutationcity.co.uk\/bp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/permutationcity.co.uk\/bp\/wp-json\/wp\/v2\/comments?post=243"}],"version-history":[{"count":1,"href":"https:\/\/permutationcity.co.uk\/bp\/wp-json\/wp\/v2\/posts\/243\/revisions"}],"predecessor-version":[{"id":244,"href":"https:\/\/permutationcity.co.uk\/bp\/wp-json\/wp\/v2\/posts\/243\/revisions\/244"}],"wp:attachment":[{"href":"https:\/\/permutationcity.co.uk\/bp\/wp-json\/wp\/v2\/media?parent=243"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/permutationcity.co.uk\/bp\/wp-json\/wp\/v2\/categories?post=243"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/permutationcity.co.uk\/bp\/wp-json\/wp\/v2\/tags?post=243"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}