The legacy of (old) code
Table of Contents
- Memory of first steps
- Stirring up the past
- What are you supposed to do?
- Rules you decided to follow
Memory of first steps
When you started out coding, you heard that solving coding katas can improve your skills.
So you searched the interwebs and found one here.
It instructed to write tests so you did. Write a test, make it pass, go on to the next one. No time to refactor when the goal is on the horizon.
At the end you’ve added some tests for good measure and called it a day.
Stirring up the past
Now that you have solved many more katas (many times) and you know about refactoring and clean code principles you decided instead to revisit an old solution of yours and see if you can improve on it.
What are you supposed to do?
- Open the classroom from here.
Make sure you can run the tests and they pass.
python tests.py -v
(Use version 3 of python)
Then refactor your code according to the clean code principles. Commit code after each steps. (Running code with passing tests, obviously. :))
Please submit an URL for a specific commit, made before the deadline.
4 Rules you decided to follow
- Always keep the existing tests passing
- Don’t delete any tests
- Commit early commit often
- Only refactor code that is covered by tests
This exercise deepens your skill to write clean code.