2024-01-03 20:00:00 +00:00
|
|
|
---
|
|
|
|
title: >
|
2024-09-08 22:09:54 +00:00
|
|
|
Make the change easy, then make the easy change
|
2024-01-03 20:00:00 +00:00
|
|
|
pubDate: 2023-06-16
|
|
|
|
permalink: >-
|
2024-12-19 20:26:33 +00:00
|
|
|
daily/2023/06/16/make-the-easy-change
|
2024-01-03 20:00:00 +00:00
|
|
|
tags: []
|
|
|
|
---
|
|
|
|
|
|
|
|
Have you worked on some code, whether it's to add or extend functionality or fix a bug and thought, "This would be much easier if..."?
|
|
|
|
|
|
|
|
A quote by Kent Beck:
|
|
|
|
|
|
|
|
> For each desired change, make the change easy (warning: this may be hard), then make the easy change
|
|
|
|
|
|
|
|
If you can refactor the code and make it easier to implement your required change, do so.
|
|
|
|
|
|
|
|
Any automated tests should be passing before and after, and I'd commit the refactored code to ensure any CI pipelines and checks are still passing.
|
|
|
|
|
|
|
|
Then, go ahead and make the required change - add the feature or fix the bug - which should now be easy.
|