From 14d0433912855d36b6fe1833c95bcdc96e8e1152 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Wed, 9 Oct 2024 22:30:44 +0100 Subject: [PATCH] Add daily email for 2024-10-04 Make the change easy, then make the easy change --- source/_daily_emails/2024-10-04.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 source/_daily_emails/2024-10-04.md diff --git a/source/_daily_emails/2024-10-04.md b/source/_daily_emails/2024-10-04.md new file mode 100644 index 000000000..ae8f615af --- /dev/null +++ b/source/_daily_emails/2024-10-04.md @@ -0,0 +1,29 @@ +--- +title: Make the change easy, then make the easy change +date: 2024-10-04 +permalink: daily/2024/10/04/make-the-change-easy--then-make-the-easy-change +tags: + - software-development + - clean-code +cta: ~ +snippet: | + Make the change easy, then make the easy change. +--- + +This week, I've been working on a particular component that processes and displays live data from APIs. + +As the data is live, it's constantly changing and it's unlikely I'll see all the different states and use-cases that the data could be in. + +There's also no guarantee the API will be available and I also may need to work offline with no Internet access to connect to the API. + +I'm reminded of the quote by Kent Beck: + +> For each desired change, make the change easy (warning: this may be hard), then make the easy change. + +In this case, to make the change easy, I need the data to be consistent, to see all the use-cases and permutations and to be available offline. + +To make the change easy, I created a fake version of the service class that returns static data I can work with. + +I can add whatever data I need to give me the examples and situations to work with and by implementing the same methods as the real service class, I can swap them without changing any other code. + +Now I can make the easy change.