2

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

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.

| improve this answer | |
0

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

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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