oliverdavies.uk/content/node.ea06edab-74a5-42d4-add9-d4dce3d0f792.json
2025-05-11 20:02:14 +01:00

100 lines
No EOL
3.9 KiB
JSON

{
"uuid": [
{
"value": "ea06edab-74a5-42d4-add9-d4dce3d0f792"
}
],
"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:07+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": "You need tests to refactor safely"
}
],
"created": [
{
"value": "2024-09-01T00:00:00+00:00"
}
],
"changed": [
{
"value": "2025-05-11T09:00:07+00:00"
}
],
"promote": [
{
"value": false
}
],
"sticky": [
{
"value": false
}
],
"default_langcode": [
{
"value": true
}
],
"revision_translation_affected": [
{
"value": true
}
],
"path": [
{
"alias": "\/daily\/2024\/09\/01\/you-need-tests-to-refactor-safely",
"langcode": "en"
}
],
"body": [
{
"value": "\n <p><a href=\"https:\/\/www.oliverdavies.uk\/daily\/2024\/08\/31\/make-it-work-then-make-it-good\">Once you have working code<\/a>, you can refactor it to make it better.<\/p>\n\n<p>You can rename variables, extract new functions or classes, ensure the code is styled and formatted correctly - anything to make the code easier to read, understand or maintain.<\/p>\n\n<p>But, the key thing is the code still needs to work.<\/p>\n\n<p>You don't want to break working code and introduce a regression, even if it is messy or difficult to read.<\/p>\n\n<p>The best way I know to approach this is by having automated tests covering this code, and ensure they are working and passing before starting to refactor.<\/p>\n\n<p>Then you can run the tests again and ensure they still pass.<\/p>\n\n<p>If they pass, the code still works and the refactoring was successful.<\/p>\n\n<p>If not, the code is broken and you need to revert the changes and start again.<\/p>\n\n ",
"format": "full_html",
"processed": "\n <p><a href=\"https:\/\/www.oliverdavies.uk\/daily\/2024\/08\/31\/make-it-work-then-make-it-good\">Once you have working code<\/a>, you can refactor it to make it better.<\/p>\n\n<p>You can rename variables, extract new functions or classes, ensure the code is styled and formatted correctly - anything to make the code easier to read, understand or maintain.<\/p>\n\n<p>But, the key thing is the code still needs to work.<\/p>\n\n<p>You don't want to break working code and introduce a regression, even if it is messy or difficult to read.<\/p>\n\n<p>The best way I know to approach this is by having automated tests covering this code, and ensure they are working and passing before starting to refactor.<\/p>\n\n<p>Then you can run the tests again and ensure they still pass.<\/p>\n\n<p>If they pass, the code still works and the refactoring was successful.<\/p>\n\n<p>If not, the code is broken and you need to revert the changes and start again.<\/p>\n\n ",
"summary": null
}
],
"feeds_item": [
{
"imported": "2025-05-11T09:00:07+00:00",
"guid": null,
"hash": "c4f9c5744c27b541d231076231201427",
"target_type": "feeds_feed",
"target_uuid": "90c85284-7ca8-4074-9178-97ff8384fe76"
}
]
}