oliverdavies.uk/content/node.da62317b-2539-43bd-8db0-94bddb14174e.yml

84 lines
3 KiB
YAML

uuid:
- value: da62317b-2539-43bd-8db0-94bddb14174e
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:01+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: 'Having less code than you started with'
created:
- value: '2025-02-07T00:00:00+00:00'
changed:
- value: '2025-05-11T09:00:01+00:00'
promote:
- value: false
sticky:
- value: false
default_langcode:
- value: true
revision_translation_affected:
- value: true
path:
- alias: /daily/2025/02/07/less
langcode: en
body:
- value: |
<p>When running commands like <code>git log</code> or viewing pull requests, you can see the number of lines that have been added, edited or removed.</p>
<p>When adding new features, it's likely you'll be adding code.</p>
<p>If you're refactoring code, you may have less code than before.</p>
<p>I like commits like this.</p>
<p>It's not true that having fewer lines of code means the code is better, but having less code makes it easier to maintain and more secure.</p>
<p>You don't need to upgrade and maintain code that you aren't using, so why not remove it?</p>
<p>Why have old TODO comments, <code>dd()</code>, <code>var_dump()</code> or <code>console.log()</code> functions in the code?</p>
<p>If they're not used, they can be removed.</p>
<p>I recently read a post that suggested there were 5 to 10 bugs in each 1,000 lines of production code as a general rule, so the less code there is, the fewer places there are for bugs to hide.</p>
<p>In general, for production code, less is more.</p>
format: full_html
processed: |
<p>When running commands like <code>git log</code> or viewing pull requests, you can see the number of lines that have been added, edited or removed.</p>
<p>When adding new features, it's likely you'll be adding code.</p>
<p>If you're refactoring code, you may have less code than before.</p>
<p>I like commits like this.</p>
<p>It's not true that having fewer lines of code means the code is better, but having less code makes it easier to maintain and more secure.</p>
<p>You don't need to upgrade and maintain code that you aren't using, so why not remove it?</p>
<p>Why have old TODO comments, <code>dd()</code>, <code>var_dump()</code> or <code>console.log()</code> functions in the code?</p>
<p>If they're not used, they can be removed.</p>
<p>I recently read a post that suggested there were 5 to 10 bugs in each 1,000 lines of production code as a general rule, so the less code there is, the fewer places there are for bugs to hide.</p>
<p>In general, for production code, less is more.</p>
summary: null
field_daily_email_cta: { }