oliverdavies.uk/content/node.7c632749-fb6d-4407-a8f2-aac72d959a4d.json
2025-05-11 20:02:14 +01:00

100 lines
No EOL
3.6 KiB
JSON

{
"uuid": [
{
"value": "7c632749-fb6d-4407-a8f2-aac72d959a4d"
}
],
"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:36+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": "Comments as communication\n"
}
],
"created": [
{
"value": "2023-07-21T00:00:00+00:00"
}
],
"changed": [
{
"value": "2025-05-11T09:00:36+00:00"
}
],
"promote": [
{
"value": false
}
],
"sticky": [
{
"value": false
}
],
"default_langcode": [
{
"value": true
}
],
"revision_translation_affected": [
{
"value": true
}
],
"path": [
{
"alias": "\/daily\/2023\/07\/21\/comments-as-communication",
"langcode": "en"
}
],
"body": [
{
"value": "\n <p>I often hear that code should be \"self-documenting\".<\/p>\n\n<p>Instead of writing a comment, you should create a function or class with that name instead.<\/p>\n\n<p>Whilst I agree with this, I think that code comments shouldn't describe what the code is doing - they should explain why the code is needed and provide any additional context to the person reading it.<\/p>\n\n<p>If a comment just says <code>Returns true<\/code> or <code>Sends an email<\/code>, that can be understood by reading the code, so isn't providing any extra value or context. They can also become outdated as the code changes.<\/p>\n\n<p>If a line of code is needed to fix a certain state or situation, or if a piece of code isn't particularly readable and isn't obvious what it does, those are good times to add comments.<\/p>\n\n ",
"format": "full_html",
"processed": "\n <p>I often hear that code should be \"self-documenting\".<\/p>\n\n<p>Instead of writing a comment, you should create a function or class with that name instead.<\/p>\n\n<p>Whilst I agree with this, I think that code comments shouldn't describe what the code is doing - they should explain why the code is needed and provide any additional context to the person reading it.<\/p>\n\n<p>If a comment just says <code>Returns true<\/code> or <code>Sends an email<\/code>, that can be understood by reading the code, so isn't providing any extra value or context. They can also become outdated as the code changes.<\/p>\n\n<p>If a line of code is needed to fix a certain state or situation, or if a piece of code isn't particularly readable and isn't obvious what it does, those are good times to add comments.<\/p>\n\n ",
"summary": null
}
],
"feeds_item": [
{
"imported": "2025-05-11T09:00:36+00:00",
"guid": null,
"hash": "d8831ac5b7ba46ed9c5772cb19a46954",
"target_type": "feeds_feed",
"target_uuid": "90c85284-7ca8-4074-9178-97ff8384fe76"
}
]
}