refactor

To rewrite code to improve its structure without changing its behavior

If you refactor code, you restructure it to make it more readable, maintainable, or efficient while keeping its original functionality intact.

Word parts

  • re: “again” (Latin)
  • factor: “do make” (Latin)

Literal meaning: “to do make again”.

Meanings

  • verb To rewrite existing source code to improve its readability, reusability, or structure without affecting its meaning or behavior
  • verb To rewrite existing text to improve its readability, reusability, or structure without intentionally affecting its meaning
  • noun The process by which source code is refactored

Origin

  • Middle English factor, “doer, maker”
  • Latin factor, “doer, maker”
  • Proto-Italic *θakjō, “to do, make”
  • Proto-Indo-European *dʰeh₁k-, “to put, place”
  • English refactor, “to rewrite code to improve structure without changing behavior”

VocabGuru: every English word taken apart into prefix, root and suffix, with what each part means and where it came from.