Get rid of old code Papers in systems nice about dynamic conservatism


In my post on Development in a monorepo and dividing it again for the distributionI have referred to that Feldatlas Entry “Software is costs, no asset“. Dr. Samek made a comment on this entry that I will repeat here:

I am so happy to see this point of view. For years we were told that we are in a “embedded software crisis” and need hordes of developers to create more and more embedded software. In fact, we may have too much (poor quality) code and don’t know how to get rid of it. This problem was the subject of my old blog post “Embedded software crisis or embedded software -glow?”

To Dr. To summarize Samek’s point in this post:

Adding code is easy. Removing dead code (without breaking the parts of the code actually used) is difficult. But without the mechanisms to drop the old luggage real Software crisis.

I remembered these points when I wrote the Monorepo contribution, and I found that I had overlooked this method of reducing the costs for the administration of my software inventory: to remove dead weight. I stand with a “software flood” and an important step to improve that eliminates as much unnecessary code as possible. That this did not even come to mind is an article that we checked in the Reading Club: Adding is preferred before subtracting the problem solution. I only focused on Add New skills more than Subtract Unnecessary elements from our software inventory.

As a first step in this effort, I carried out some (pre) spring cleaning. I reduced the number of active repositories by ~ 40%over two hours. Currently, 45 of the remaining repository are summarized in the Monorepo.

  • Everything I would never touch again was deleted, such as:
    • Old customer projects
    • Failed and broken internal projects
    • Unmodified forks
  • Everything that had to be kept for historical reasons was archived:
    • Public repository that is referred to in website articles
    • Public/private repository that is referred to in the history of active projects
    • Public repositories that may have users (based on fork/watch counts)

A common problem when deleting the old code is that “it could be useful again in the future”. Of course deleted code within A repository is never really lost – it is kept in the history of your revision control system. However, if you delete repositories as a whole, you can make your mind easier by keeping a copy:

  • Create a repository “Cold Storage” and add this repository to add loose code.
  • Check the repository into a “Cold Storage” folder and get your story on site.
    • If you ever have to create the repository again, you can exceed and restore the same commit-hashes.

Really, that’s just a safety blanket. It has been many years since I had to comb through the archives to find a certain piece of code. I do not expect the newcomers to change this fact.

References



Source link