From 2bf21b54fdedf0e865f235644faa6b5084a47ccb Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Tue, 18 Feb 2025 00:33:38 +0000 Subject: [PATCH] Add daily email for 2025-02-04 Good software is easy to change --- source/_daily_emails/2025-02-04.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 source/_daily_emails/2025-02-04.md diff --git a/source/_daily_emails/2025-02-04.md b/source/_daily_emails/2025-02-04.md new file mode 100644 index 00000000..b0e3e32c --- /dev/null +++ b/source/_daily_emails/2025-02-04.md @@ -0,0 +1,24 @@ +--- +title: Good software is easy to change +date: 2025-02-04 +permalink: daily/2025/02/04/changeable +tags: + - software-development +cta: ~ +snippet: | + Good software is easy to change. +--- + +As well as being easy to test, good software is easy to change. + +If requirements change or a bug is found, it should be easy to change the code. + +Simple code is easier to read and fix, and code split into smaller functions and classes - particularly when using design patterns - make it easier to change the existing code or its behaviour by writing new code. + +For example, if you need to change your payment gateway provider, ideally your software has been written so that each payment gateway has its own implementation and then can be swapped without needing to change the original code. + +If you need to change the behaviour of a class, you could use a Decorator to wrap and extend it. + +Having tests also makes the code easier to change as you can validate and verify the behaviour before and after the change. + +Changing code that doesn't have tests is risky, so if there aren't any, write some before changing the code.