oliverdavies.uk/content/node.5e37f5e3-8ada-4d61-925d-5033258e441f.json

91 lines
No EOL
3.8 KiB
JSON

{
"uuid": [
{
"value": "5e37f5e3-8ada-4d61-925d-5033258e441f"
}
],
"langcode": [
{
"value": "en"
}
],
"type": [
{
"target_id": "daily_email",
"target_type": "node_type",
"target_uuid": "8bde1f2f-eef9-4f2d-ae9c-96921f8193d7"
}
],
"revision_timestamp": [
{
"value": "2025-05-11T09:00:02+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-05-11T09:00:02+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 <p>I was recently writing code for a project and found myself making assumptions about what I was writing.<\/p>\n\n<p>I was creating my own requirements.<\/p>\n\n<p>Something no-one asked for.<\/p>\n\n<p>I was assuming a value was always going to be a certain number of digits long.<\/p>\n\n<p>I was writing code that verified this was true or throw an Exception.<\/p>\n\n<p>Until I found out that that one of the values wasn't the same length as the others.<\/p>\n\n<p>This could be an error in the data or it could correct.<\/p>\n\n<p>No-one told me the lengths were always going to be the same.<\/p>\n\n<p>So why was I checking it?<\/p>\n\n<p>Why was I adding bugs to the code?<\/p>\n\n<p>I've reverted the code that checks the length of the value and gone to find clarification.<\/p>\n\n<p>If it's an issue, it'll be fixed in the source data.<\/p>\n\n<p>If the lengths should all be the same, I'll potentially re-add the check.<\/p>\n\n<p>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 <p>I was recently writing code for a project and found myself making assumptions about what I was writing.<\/p>\n\n<p>I was creating my own requirements.<\/p>\n\n<p>Something no-one asked for.<\/p>\n\n<p>I was assuming a value was always going to be a certain number of digits long.<\/p>\n\n<p>I was writing code that verified this was true or throw an Exception.<\/p>\n\n<p>Until I found out that that one of the values wasn't the same length as the others.<\/p>\n\n<p>This could be an error in the data or it could correct.<\/p>\n\n<p>No-one told me the lengths were always going to be the same.<\/p>\n\n<p>So why was I checking it?<\/p>\n\n<p>Why was I adding bugs to the code?<\/p>\n\n<p>I've reverted the code that checks the length of the value and gone to find clarification.<\/p>\n\n<p>If it's an issue, it'll be fixed in the source data.<\/p>\n\n<p>If the lengths should all be the same, I'll potentially re-add the check.<\/p>\n\n<p>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
}
]
}