{ "uuid": [ { "value": "d8e07f33-367e-4993-a217-4ba88a145d40" } ], "langcode": [ { "value": "en" } ], "type": [ { "target_id": "daily_email", "target_type": "node_type", "target_uuid": "8bde1f2f-eef9-4f2d-ae9c-96921f8193d7" } ], "revision_timestamp": [ { "value": "2025-04-16T14:12:56+00:00" } ], "revision_uid": [ { "target_type": "user", "target_uuid": "b8966985-d4b2-42a7-a319-2e94ccfbb849" } ], "revision_log": [], "status": [ { "value": true } ], "uid": [ { "target_type": "user", "target_uuid": "b8966985-d4b2-42a7-a319-2e94ccfbb849" } ], "title": [ { "value": "Don't make assumptions" } ], "created": [ { "value": "2025-01-08T00:00:00+00:00" } ], "changed": [ { "value": "2025-04-16T14:12:56+00:00" } ], "promote": [ { "value": false } ], "sticky": [ { "value": false } ], "default_langcode": [ { "value": true } ], "revision_translation_affected": [ { "value": true } ], "path": [ { "alias": "\/daily\/2025\/01\/08\/don-t-make-assumptions", "langcode": "en" } ], "body": [ { "value": "\n
I was recently writing code for a project and found myself making assumptions about what I was writing.<\/p>\n\n
I was creating my own requirements.<\/p>\n\n
Something no-one asked for.<\/p>\n\n
I was assuming a value was always going to be a certain number of digits long.<\/p>\n\n
I was writing code that verified this was true or throw an Exception.<\/p>\n\n
Until I found out that that one of the values wasn't the same length as the others.<\/p>\n\n
This could be an error in the data or it could correct.<\/p>\n\n
No-one told me the lengths were always going to be the same.<\/p>\n\n
So why was I checking it?<\/p>\n\n
Why was I adding bugs to the code?<\/p>\n\n
I've reverted the code that checks the length of the value and gone to find clarification.<\/p>\n\n
If it's an issue, it'll be fixed in the source data.<\/p>\n\n
If the lengths should all be the same, I'll potentially re-add the check.<\/p>\n\n
Until I'm sure, I'll only write what's needed to deliver the feature and stop adding my own requirements and assumptions.<\/p>\n\n ", "format": "full_html", "processed": "\n
I was recently writing code for a project and found myself making assumptions about what I was writing.<\/p>\n\n
I was creating my own requirements.<\/p>\n\n
Something no-one asked for.<\/p>\n\n
I was assuming a value was always going to be a certain number of digits long.<\/p>\n\n
I was writing code that verified this was true or throw an Exception.<\/p>\n\n
Until I found out that that one of the values wasn't the same length as the others.<\/p>\n\n
This could be an error in the data or it could correct.<\/p>\n\n
No-one told me the lengths were always going to be the same.<\/p>\n\n
So why was I checking it?<\/p>\n\n
Why was I adding bugs to the code?<\/p>\n\n
I've reverted the code that checks the length of the value and gone to find clarification.<\/p>\n\n
If it's an issue, it'll be fixed in the source data.<\/p>\n\n
If the lengths should all be the same, I'll potentially re-add the check.<\/p>\n\n
Until I'm sure, I'll only write what's needed to deliver the feature and stop adding my own requirements and assumptions.<\/p>\n\n ", "summary": null } ], "feeds_item": [ { "imported": "2025-04-16T14:12:56+00:00", "guid": null, "hash": "2ddc207d69aba210aead45269c83988b", "target_type": "feeds_feed", "target_uuid": "90c85284-7ca8-4074-9178-97ff8384fe76" } ] }