{ "uuid": [ { "value": "11d7adfc-89a7-4d4c-b0b3-47577970178d" } ], "langcode": [ { "value": "en" } ], "type": [ { "target_id": "daily_email", "target_type": "node_type", "target_uuid": "8bde1f2f-eef9-4f2d-ae9c-96921f8193d7" } ], "revision_timestamp": [ { "value": "2025-05-11T06:09:49+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-11T06:09:49+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
One of my goals when coding is to reduce the amount of nesting in the code I write.<\/p>\n\n
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
My aim is to have a maximum of two or three levels of indentation, though sometimes this isn't possible.<\/p>\n\n
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
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
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 One of my goals when coding is to reduce the amount of nesting in the code I write.<\/p>\n\n 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 My aim is to have a maximum of two or three levels of indentation, though sometimes this isn't possible.<\/p>\n\n 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 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 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 else<\/code> keyword and other good practices that I like to try and implement when possible.--<\/p>\n\n ",
"format": "full_html",
"processed": "\n
else<\/code> keyword and other good practices that I like to try and implement when possible.--<\/p>\n\n ",
"summary": null
}
],
"feeds_item": [
{
"imported": "2025-05-11T06:09:49+00:00",
"guid": null,
"hash": "6f502f1378e2ffcb9acf63bd11ff5325",
"target_type": "feeds_feed",
"target_uuid": "90c85284-7ca8-4074-9178-97ff8384fe76"
}
]
}