oliverdavies.uk/source/_daily_emails/2023-06-08.md

19 lines
663 B
Markdown
Raw Permalink Normal View History

2024-01-03 20:00:00 +00:00
---
title: >
2024-09-08 22:09:54 +00:00
Write less Drupal code
2024-01-03 20:00:00 +00:00
pubDate: 2023-06-08
permalink: >-
daily/2023/06/08/write-less-drupal-code
2024-01-03 20:00:00 +00:00
tags:
2024-09-08 22:09:54 +00:00
- drupal
- php
2024-01-03 20:00:00 +00:00
---
An approach I like to make my Drupal code more maintainable is to write less of it and move any generic PHP code into separate framework-agnostic libraries.
These could be in open-sourced packages installed from Packagist or kept within the same repository.
Having less Drupal-specific code keeps modules smaller and easier to maintain and upgrade.
If I need to upgrade a module from Drupal 7 to Drupal 10, I can reuse the generic code and focus on changing its integration points with Drupal to make it compatible.