Intro

Code refactoring is the action of modifying code without changing its purpose but with the goal of making it better. It can be better for reasons such as, code maintainability and extensibility for instance.

Why it helped

We haven't had a course to teach us how to program properly. We knew that there were better ways to code than others, but at least in my case, I wasn't able to figure out quickly the different steps that I could use to refactor code.

Both the lab involving TDD and the two last labs that were mostly about refactoring helped me to better see how to refactor code. TDD was useful to add appropriate tests and be able to refactor code step by step without "breaking everything".

It also helped me a lot to see why object oriented programming helps a lot with code simplicity, maintainability and extension. Indeed, I don't really remember object oriented lectures focusing a lot on the why one or another concept are important, and what it brings to the code. It seems to me that refactoring and bad smells guiding these follow the same underlying purpose as object oriented programming.

It also crosses the topic of design patterns, and shows why these are useful things to know.