35 lines
1.4 KiB
Markdown
35 lines
1.4 KiB
Markdown
---
|
|
title: Code is a liability, not an asset
|
|
date: 2024-01-14
|
|
permalink: daily/2024/01/14/code-is-a-liability-not-an-asset
|
|
snippet: |
|
|
Is code a liability or an asset? The more you write, the more you need to maintain.
|
|
tags:
|
|
- software-development
|
|
- drupal
|
|
---
|
|
|
|
Something I mentioned during my [podcast episode with Mike Karthauser][episode] is a quote I saw recently:
|
|
|
|
> Code is a liability, not an asset.
|
|
|
|
The more code you write, the more you have to maintain.
|
|
|
|
The more complex the code is, the harder it is to maintain.
|
|
|
|
For example, when adding a new page to a Drupal application, should you write a custom route, a Controller, and a Repository and write accompanying tests, or should you use the Views module?
|
|
|
|
Both can give the same result.
|
|
|
|
One involves writing and maintaining custom code; the other uses a no-code approach available in Drupal, which creates the page and output based on your selections.
|
|
|
|
There isn't a correct answer.
|
|
|
|
The option you choose will depend on what problem you're solving, what deadlines you're working to, and any precedents set within the project.
|
|
|
|
It also depends on whether you want to maintain the code you write over time, fix any bugs, refactor it, and upgrade it as part of major Drupal version upgrades.
|
|
|
|
Like a house, car or pet, any code you write will need ongoing care and maintenance in the future - not just now.
|
|
|
|
[episode]: {{site.url}}/podcast/7-mike-karthauser-testing-legacy
|