Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
})
})




export const metadata: Metadata = mergeFrontmatterAndDefaultMetadata({
title: "Black Sheep Code",
description: "A blog about modern web development"
Expand All @@ -42,9 +45,9 @@
<meta name="viewport" content="width=device-width,initial-scale=1" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github-dark.min.css" media="(prefers-color-scheme: dark)" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" media="(prefers-color-scheme: light)" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,300;1,400;1,500;1,600;1,700;1,800&display=swap" />

Check warning on line 48 in src/app/layout.tsx

View workflow job for this annotation

GitHub Actions / lint-and-types

Custom fonts not added in `pages/_document.js` will only load for a single page. This is discouraged. See: https://nextjs.org/docs/messages/no-page-custom-font
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,[email protected],100..700,0..1,-50..200" />

Check warning on line 49 in src/app/layout.tsx

View workflow job for this annotation

GitHub Actions / lint-and-types

Custom fonts not added in `pages/_document.js` will only load for a single page. This is discouraged. See: https://nextjs.org/docs/messages/no-page-custom-font

Check warning on line 49 in src/app/layout.tsx

View workflow job for this annotation

GitHub Actions / lint-and-types

A font-display parameter is missing (adding `&display=optional` is recommended). See: https://nextjs.org/docs/messages/google-font-display
<script async src="https://www.googletagmanager.com/gtag/js?id=G-0NB66YHJYM"></script>

Check warning on line 50 in src/app/layout.tsx

View workflow job for this annotation

GitHub Actions / lint-and-types

Prefer `next/script` component when using the inline script for Google Analytics. See: https://nextjs.org/docs/messages/next-script-for-ga
<script
dangerouslySetInnerHTML={{
__html: `
Expand Down
96 changes: 96 additions & 0 deletions src/routes/posts/stop_trying_to_understand_the_code_nah.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
---
meta:
title: Stop trying to understand the code? Nah.
description: If your tool is one that is being depended on - someone needs to understand it.
dateCreated: 2026-10-28


tags:
- "ai"
---

import { GithubPermalinkRsc } from "react-github-permalink/dist/rsc";

There seems to be quite a popular view currently that says:

> Reading the code that AI outputs is like reading the compiled assembly. That's what people did once upon a time when compilers were first invented.

or

> We're no longer software engineers, we're CTOs. The CTO doesn't understand every line of code in the organisation they manage either.

On the first point, I think that first point does poigantly get at a feeling of discomfort we are currently experiencing as software developers - there is an amount of having to let go.

is that we don't trust don't the technololgy when we first use it, and as we use it more and see it being reliable then we can trust it more.

But this isn't to say that it's silly to to this period of verification - it could be considered sensible due diligence.

There's a larger point here. Yes - when I use a compiler I just trust that it works. But that's not to say that no one knows how a compiler works. _Somebody knows how the compiler works_.

When I write some high level application code, there are multiple layers of abstraction it's built on top, that I do not have a solid understanding of, and nor do I need one. I don't need to know exactly how a car works, to drive one, either.

But in the pre-AI world, all of those layers are built by one one who understands what it's doing, however flawed their understanding may be.

And yes - in the pre-AI world, there's was always a bit of not-really-understanding-the-thing-but-good-enough-to-get-the-thing-going.

But in the AI world if we're building whole layers of our application on code that no human go to understand - that that chain of understanding is broken.

## There's plenty of code that it's ok not to understand

There absolutely is a place for not understanding the code.

### Throw away code

Here's some interesting code that Codex created, when I tasked it with sorting out my media server - putting everything into a consistent folder and file name format.

```python
for src in x['unresolved']:
s=Path(src); choices=[]
for op in vops:
v=Path(op['source']); c=common(s.parent,v.parent)
exact=v.stem.lower() in str(s).lower(); match=token(str(s)) and token(str(s))==token(v.stem)
single=s.parent==v.parent and len([o for o in vops if Path(o['source']).parent==v.parent and o['reason'] not in ['series extra','movie extra']])==1
if c>=3 and (exact or match or single): choices.append((1000*int(exact)+100*int(bool(match))+c,op))
if not choices: left.append(src); continue
choices.sort(key=lambda t:t[0],reverse=True)
if len(choices)>1 and choices[0][0]==choices[1][0]: left.append(src); continue
op=choices[0][1]; dest=op.get('destination') or op.get('keeper')
if dest in opmap: dest=opmap[dest].get('destination') or opmap[dest].get('keeper')
if not dest: left.append(src); continue
d=Path(dest); label=re.sub('[^a-zA-Z0-9_.-]','_',s.stem); tail='.'+label
lang={'english':'en','eng':'en','french':'fr','italian':'it','dutch':'nl','nor':'no','portuguese':'pt','finnish':'fi','swedish':'sv','chinese':'zh','danish':'da','german':'de','spanish':'es','arabic':'ar','czech':'cs'}
for n,code in lang.items():
```

Just the formatting of this makes it incomprehensible to me.

But this is throwaway code - it's used for the job and we never need to see this again.


### Code that from the outset we are aren't trying to understand

I've been experimenting with ralph loops and autonomous agentic workflows to produce a zero player game. Perhaps a post for another time.

In these, from the outset the goal was never to pretend to understand it, this is fine.

### Well encapsulated code

This is like copy pasting an email regex of stack overflow - it works, you have some tests for it, you don't need to understand it. Its blast radius is limited.

## But for code you're going to maintain - you should understand it

Here is a sample commit

<GithubPermalinkRsc permalink="https://github.com/dwjohnston/thunderjar/blob/0a37b114567d589f9de166cccc8c4c637a3115c1/scripts/release/build-versioned-docs.ts#L5-L32"/>

from this pull request where I had asked AI to extend my build pipeline to:

- Add the ability to create a release candidate from current main
- A preview release from a given pull request
- Have every version of docs based on tags.

The whole pull request probably works, and I could just YOLO merge it and test it works.

But it would always be something that is weighing on me.

Instead, the approach I've taken has been to update my skills and re-run the task. I'm quite confident AI will be able to do it.
Loading