to factor out
- phrasal verb
- Jargon
- To improve our code's organization, we decided to factor out the repeated calculations into a single function.
Examples
-
The team managed to factor out the common logic into a reusable module, making the application more efficient.
-
So we can actually factor this out like this.
-
So what first thing I'm going to do is factor out a common X.
-
You've managed to factor it out, so let's see.
-
Even for this code, much of it can be factored out into libraries or frameworks that can be maintained separately from the main project.
Blog text (30) -
He suggested that we should factor out the duplicate code to reduce maintenance difficulties in the future.
Synonyms
Rewrite code to split it into small parts that each do one job
Surface Forms
Morphology
factor + out
The particle 'out' commonly signals removal or extraction and 'factor' can carry the sense of taking out a common part (as in mathematics), so a learner could partly infer that something is being extracted from a larger whole. However, the specific software-refactoring meaning (extracting duplicated code into a separate function/module) is a technical extension and not fully predictable from the everyday sense of 'factor' many learners know, making this only partially transparent.
Etymology
Factor out in programming means to move repeated instructions into one place. Think of copying the same steps from many pages onto a single sheet so you can change them all at once; that's why it means 'to remove duplicate code to make a program cleaner'.