10

I'm creating a branch in source control to strip large parts of an application out. Whilst giving this branch a name, I started questioning if "removal" is the right word.

As I'm not specifically just removing the code, I'm also rewriting a few other parts to fit around the new code structure.

I was wondering, is there a synonym for "removal" when talking about code?

I was thinking maybe "refactor", but I'm only about 10-20% of the code change will be refactoring. Most of the changes will be literally stripping code out.

  • 4
    Code removal is often the most important part of refactoring. I think most people would understand what you are doing is refactoring. – Dan Wilson Nov 28 '19 at 14:31
  • 2
    Call it whatever you and your coworkers like best. "Cleaning up" sounds good to me, "Refactoring" as well (as long as you do this in small steps). – Doc Brown Nov 28 '19 at 14:32
  • 1
    Decomposing perhaps ? – High Performance Mark Nov 28 '19 at 15:08
  • 1
    Are you trying to change what the program does? If so, then refactoring is not appropriate. – user253751 Nov 28 '19 at 18:01
  • 3
    Don't overthink it... You're refactoring, might do some clean up. Even if the branch name only says Refactoring (whatever), the commit comments can be more explicit as to what takes place. – MetalMikester Nov 28 '19 at 19:42
12

The three terms that I would consider would be "obsolescence", "deprecation" or "refactoring".

Obsolescence is when something that works is phased out. Deprecation refers to a process by which the use of something is discouraged. Depending on the delivery and use of a system, both obsolescence and deprecation must be planned and communicated over time.

Refactoring is changes to the internal structure of code. After something is made obsolete or deprecated, it may be removed. The removal may lead to the ability to refactor the code to better structure it based on those changes.

| improve this answer | |
12

I think refactor is appropriate here, but I sometimes call this cleanup.

| improve this answer | |
  • 5
    In my opinion, refactor does not quite match, as OP already stated, but cleanup sounds perfect to me. – Hartmut Braun Nov 28 '19 at 18:13
  • Cleanup is much more clear in this case. So, +1 for cleanup – Andrea Girardi Dec 4 '19 at 16:15
  • @HartmutBraun to me, the meaning of refactoring is: "Modify the code without changing the output", which would cover removing unneeded code. – Juha Untinen Dec 4 '19 at 23:38
  • @JuhaUntinen yes, it is refactoring, but in this case OP seemed to be asking for a branch name for a specific kind of refactoring, here removing obsolete code. In my experience, refactoring in steps, first cleanup and then the “real” refactoring, has benefitted me a lot. – Hartmut Braun Dec 5 '19 at 7:06
5

I usually go with the term purge when I need to replace rotten code with fresh functionality.

You can name your branch with any convention you like:

purge-your-feature

or

purge/your-feature

When pushing changes you can use conventional commits to be more semantic about them.

| improve this answer | |
4

The term I use is Prune. Like pruning a tree. You are intentionally and with thought removing parts / branches of code - whether dead or it’s unwanted for other reasons.

| improve this answer | |
2

We use the word decommission, such as in "I am decommissioning this obsolete component." or "Decommissioning of unused code."

| improve this answer | |
2

Everything is a refactoring so it doesn't tell me anything. Removal of X, cleanup, pruning, retiring, eliminating, throwing out, stripping (away) are much more expressive.

Alternatives may also be (if applicable): merging component X into Y / combining X and Y etc.

However, the branch will be gone once you are done. If you want to spend brain capacity on naming stuff for git, rather spend it on naming commits, they stay forever (more or less).

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.