oliverdavies.uk/source/_daily_emails/2025-02-04.md
Oliver Davies 2bf21b54fd Add daily email for 2025-02-04
Good software is easy to change
2025-02-18 00:41:58 +00:00

1.1 KiB

title date permalink tags cta snippet
Good software is easy to change 2025-02-04 daily/2025/02/04/changeable
software-development
~ 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.