oliverdavies.uk/content/node.56776268-7d1e-47b3-8c3a-bb7dc5d102f4.json
2025-05-30 02:34:52 +01:00

100 lines
No EOL
4.1 KiB
JSON

{
"uuid": [
{
"value": "56776268-7d1e-47b3-8c3a-bb7dc5d102f4"
}
],
"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:16+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": "Avoiding nesting"
}
],
"created": [
{
"value": "2024-04-07T00:00:00+00:00"
}
],
"changed": [
{
"value": "2025-05-11T09:00:16+00:00"
}
],
"promote": [
{
"value": false
}
],
"sticky": [
{
"value": false
}
],
"default_langcode": [
{
"value": true
}
],
"revision_translation_affected": [
{
"value": true
}
],
"path": [
{
"alias": "\/daily\/2024\/04\/07\/avoiding-nesting",
"langcode": "en"
}
],
"body": [
{
"value": "\n <p>One of my goals when coding is to reduce the amount of nesting in the code I write.<\/p>\n\n<p>I mean both in my PHP code where if conditions and foreach loops can be nested within each other, and CSS and Sass files, which support nesting CSS rules.<\/p>\n\n<p>My aim is to have a maximum of two or three levels of indentation, though sometimes this isn't possible.<\/p>\n\n<p>Doing so where I can, though, makes my code easier to read and understand and encourages other clean code approaches, such as having small and well-named functions.<\/p>\n\n<p>In CSS or Sass, avoiding nesting makes it easier to find a rule I'm looking for instead of having to find how rules have been nested or names have been concatenated - making it hard to search or grep for a string.<\/p>\n\n<p>This approach is part of \"object callisthenics\", which was introduced by Jeff Bay and includes other approaches that I like to follow, such as not using the <code>else<\/code> keyword and other good practices that I like to try and implement when possible.--<\/p>\n\n ",
"format": "full_html",
"processed": "\n <p>One of my goals when coding is to reduce the amount of nesting in the code I write.<\/p>\n\n<p>I mean both in my PHP code where if conditions and foreach loops can be nested within each other, and CSS and Sass files, which support nesting CSS rules.<\/p>\n\n<p>My aim is to have a maximum of two or three levels of indentation, though sometimes this isn't possible.<\/p>\n\n<p>Doing so where I can, though, makes my code easier to read and understand and encourages other clean code approaches, such as having small and well-named functions.<\/p>\n\n<p>In CSS or Sass, avoiding nesting makes it easier to find a rule I'm looking for instead of having to find how rules have been nested or names have been concatenated - making it hard to search or grep for a string.<\/p>\n\n<p>This approach is part of \"object callisthenics\", which was introduced by Jeff Bay and includes other approaches that I like to follow, such as not using the <code>else<\/code> keyword and other good practices that I like to try and implement when possible.--<\/p>\n\n ",
"summary": null
}
],
"feeds_item": [
{
"imported": "1970-01-01T00:32:50+00:00",
"guid": null,
"hash": "6f502f1378e2ffcb9acf63bd11ff5325",
"target_type": "feeds_feed",
"target_uuid": "90c85284-7ca8-4074-9178-97ff8384fe76"
}
]
}