Clean Code
How I will write the code if I have to pay attention to all these rules?
First, you make it work, then you refactor.
Uncle Bob, in clean code, defends that the best order to write code is:
Write unit tests.
Create code that works.
Refactor to clean the code.
Write all the tests, make it work and, when you are sure that everything is the way that's supposed to be, refactor removing all the dirty code and applying design patterns.
Particularly, I don't have the habit to write tests before the code (TDD), however, test the code before doing a refactoring is indispensable. Only then we can be sure that your code will always work, even after so much modification.
Last updated
Was this helpful?