{ "uuid": [ { "value": "4297cfc8-623f-4d32-b353-5a441c2c632f" } ], "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:51+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": "Writing readable code\n" } ], "created": [ { "value": "2022-12-01T00:00:00+00:00" } ], "changed": [ { "value": "2025-05-11T09:00:51+00:00" } ], "promote": [ { "value": false } ], "sticky": [ { "value": false } ], "default_langcode": [ { "value": true } ], "revision_translation_affected": [ { "value": true } ], "path": [ { "alias": "\/daily\/2022\/12\/01\/writing-readable-code", "langcode": "en" } ], "body": [ { "value": "\n
This week, I needed to investigate and fix a bug within some existing code.<\/p>\n\n
It's code written some time ago and not by anyone working on the team.<\/p>\n\n
The code wasn't very readable, so before I could fix the bug, I needed to figure out what the code was supposed to be doing.<\/p>\n\n
I started to write a list of things that would make the code easier to read and understand - no single-letter variable names, reduced levels of indentation and splitting some nested ternary operators to use separate return statements.<\/p>\n\n
I also watched a video of a conference talk titled \"Writing code you won't hate tomorrow\", which re-introduced me to Object Callisthenics.<\/p>\n\n
They are from \"The ThoughtWorks Anthology\" book and are some steps that include some of the points that I had written:<\/p>\n\n
As well as the original book, there are numerous blog posts and videos on this topic.<\/p>\n\n
Why try some of them on the next code you write and see if it's easier to read and understand?<\/p>\n\n ", "format": "full_html", "processed": "\n
This week, I needed to investigate and fix a bug within some existing code.<\/p>\n\n
It's code written some time ago and not by anyone working on the team.<\/p>\n\n
The code wasn't very readable, so before I could fix the bug, I needed to figure out what the code was supposed to be doing.<\/p>\n\n
I started to write a list of things that would make the code easier to read and understand - no single-letter variable names, reduced levels of indentation and splitting some nested ternary operators to use separate return statements.<\/p>\n\n
I also watched a video of a conference talk titled \"Writing code you won't hate tomorrow\", which re-introduced me to Object Callisthenics.<\/p>\n\n
They are from \"The ThoughtWorks Anthology\" book and are some steps that include some of the points that I had written:<\/p>\n\n
As well as the original book, there are numerous blog posts and videos on this topic.<\/p>\n\n
Why try some of them on the next code you write and see if it's easier to read and understand?<\/p>\n\n ", "summary": null } ] }