From f4d5514a8ba7fd9ee6142233b9b670d9de2ae646 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Sun, 12 Jan 2025 00:49:01 +0000 Subject: [PATCH] Add daily email for 2025-01-08 Don't make assumptions --- source/_daily_emails/2025-01-08.md | 38 ++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 source/_daily_emails/2025-01-08.md diff --git a/source/_daily_emails/2025-01-08.md b/source/_daily_emails/2025-01-08.md new file mode 100644 index 00000000..39f64f4a --- /dev/null +++ b/source/_daily_emails/2025-01-08.md @@ -0,0 +1,38 @@ +--- +title: Don't make assumptions +date: 2025-01-08 +permalink: daily/2025/01/08/don-t-make-assumptions +tags: + - software-development +cta: call +snippet: | + I recently caught myself making assumptions and creating new requirements in a codebase that no-one asked for. +--- + +I was recently writing code for a project and found myself making assumptions about what I was writing. + +I was creating my own requirements. + +Something no-one asked for. + +I was assuming a value was always going to be a certain number of digits long. + +I was writing code that verified this was true or throw an Exception. + +Until I found out that that one of the values wasn't the same length as the others. + +This could be an error in the data or it could correct. + +No-one told me the lengths were always going to be the same. + +So why was I checking it? + +Why was I adding bugs to the code? + +I've reverted the code that checks the length of the value and gone to find clarification. + +If it's an issue, it'll be fixed in the source data. + +If the lengths should all be the same, I'll potentially re-add the check. + +Until I'm sure, I'll only write what's needed to deliver the feature and stop adding my own requirements and assumptions.