13

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.

Thomas Owens
  • 79,623
  • 18
  • 192
  • 283
Jessica
  • 349
  • 2
  • 9

6 Answers6

13

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

muksie
  • 239
  • 1
  • 2
  • 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 04 '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 04 '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 05 '19 at 07:06
13

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.

Thomas Owens
  • 79,623
  • 18
  • 192
  • 283
6

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.

A1rPun
  • 163
  • 5
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.

BIBD
  • 421
  • 3
  • 11
3

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

Jakub Zaverka
  • 2,429
  • 2
  • 14
  • 8
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).

Frank Hopkins
  • 340
  • 1
  • 5