oliverdavies.uk/content/node.ea06edab-74a5-42d4-add9-d4dce3d0f792.json

91 lines
3.6 KiB
JSON
Raw Normal View History

2025-05-11 07:15:45 +01:00
{
"uuid": [
{
2025-05-11 09:40:11 +01:00
"value": "ea06edab-74a5-42d4-add9-d4dce3d0f792"
2025-05-11 07:15:45 +01:00
}
],
"langcode": [
{
"value": "en"
}
],
"type": [
{
"target_id": "daily_email",
"target_type": "node_type",
"target_uuid": "8bde1f2f-eef9-4f2d-ae9c-96921f8193d7"
}
],
"revision_timestamp": [
{
2025-05-11 09:40:11 +01:00
"value": "2025-05-11T09:00:07+00:00"
2025-05-11 07:15:45 +01: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": [
{
2025-05-11 09:40:11 +01:00
"value": "2025-05-11T09:00:07+00:00"
2025-05-11 07:15:45 +01: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": [
{
2025-05-30 02:14:32 +01:00
"value": "\n <p><a href=\"\/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 ",
2025-05-11 07:15:45 +01:00
"format": "full_html",
2025-05-30 02:14:32 +01:00
"processed": "\n <p><a href=\"http:\/\/default\/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 ",
2025-05-11 07:15:45 +01:00
"summary": null
}
]
}