Are these words mean the same? I'm a programmer and I was wondered by this question while uploading a new file to Github. I want to say reformatted abc function or refactored abc function.

ps. I apologize for some confusion about the terminology and the English language.

2 Answers 2


As a programmer, I would say that reformatting a function is limited specifically to fixing whitespace, such as improving indentation or splitting long lines.

On the other hand, refactoring a function is making changes like splitting it into multiple functions, simplifying by introducing variables, etc. It is about improving the code quality, but should not change the behavior. For example, refactoring should not add new features or fix any bugs.


There is a difference.

Reformat is defined as:

To format anew or again, generally erasing a previous format.

Refactor is defined as::

To rewrite existing source code in order to improve its readability, reusability or structure without affecting its meaning or behaviour

So refactor is more used to improve source code as opposed to changing it. However, reformatting is changing the format and often erasing the previous format.

So yes, there is a difference

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .