The Haunt.
Short reads on software in the age of AI. 3 minutes or less. Come back often.
- The craft
priority_queue is a max-heap. Flip it.
Pass std::greater as the third template argument, and remember the comparator says which item comes out last.
3 min read - The craft
HashMap for speed, TreeMap for order.
Use HashMap unless you need keys in sorted order or the nearest key to a value, which is what TreeMap is for.
3 min read - The craft
JavaScript has no priority queue. Write one.
JavaScript has no built-in heap, so write a small binary heap with a comparator instead of sorting an array on every insert.
3 min read - The craft
list.pop(0) is the slow line in your BFS.
Use a list for a stack and a deque for a queue, because removing from the front of a list moves every other item.
3 min read - The craft
heapq only pops the smallest. Here is the largest.
Store negated numbers to make heapq behave as a max-heap, and add a counter so equal priorities never compare the items.
3 min read - The craft
Pick the language you will actually practise in.
The algorithms are the same in every language, so choose the one you will practise in and learn the traps it sets.
3 min read - Building with AI
AGENTS.md or CLAUDE.md? Write one file and point the other at it.
Keep one instructions file, make every tool read it, and keep it short enough to be followed.
3 min read - The craft
100% coverage, and the bug is still there.
Coverage finds code nobody tested, but it cannot tell you whether the tests you have are any good.
3 min read - Building with AI
Slopsquatting: the package your assistant made up, and the attacker who registered it.
Treat every new dependency in an AI-written change as a claim to check, not a fact.
3 min read - Building with AI
Spec-driven development is not waterfall if the spec fits on one page.
A spec earns its place when its examples become the tests you check the agent against.
3 min read - Building with AI
Test-driven development with AI: the agent writes the code, not the tests.
If the agent writes both the tests and the code, it is marking its own homework.
3 min read - Building with AI
Your vibe-coded app works. Is it safe to launch?
An app that works for you can still show every visitor everyone else's data.
3 min read - Building with AI
A code review prompt that starts from the request.
Give the reviewer the request, not just the diff, and treat what it says as leads to check.
3 min read - Building with AI
Seven AI coding guidelines a team will actually follow.
Write rules for the people first, then tell the agent what the people decided.
3 min read - Building with AI
You don't need a new tool to write test cases with AI.
A requirement and a chat assistant are enough, and the skill is choosing which cases matter.
3 min read - The craft
Stop resubmitting. Debug the failing case.
Each resubmit without a reason is a guess, and the failing case is telling you exactly where to look.
3 min read - Building with AI
Stop re-prompting. Debug it.
Asking the assistant to try again is a guess, and debugging is how you stop guessing.
3 min read - The craft
Flaky tests need a method, not a retry button.
A flaky test is a bug that only shows up sometimes, so debug it like one.
3 min read - Building with AI
Introduce AI to your team with an hour, not a slide deck.
People trust a tool they have caught making a mistake, not one they watched in a demo.
3 min read - Building with AI
Your AI tests pass. Do they check anything?
Mutation testing is "make every test fail once", done by a machine.
3 min read - Staying relevant
Will AI replace QA? It is making more to check.
When code is cheap to produce, the people who can prove it works become the bottleneck.
3 min read - Building with AI
Can AI write your unit tests? Only if they can fail.
A test you have never seen fail is a test you are trusting, not checking.
3 min read - The industry
Measure what AI changes, not how much it writes.
Count what reaches users and stays there, not lines generated.
3 min read - Building with AI
How to review AI-generated code.
Start from what was asked, not from the tidy code you were handed.
3 min read - Staying relevant
Use AI as a tutor, not a ghostwriter.
The same tool can teach you or think for you, and the difference is how you ask.
3 min read - The craft
Read more code than you write.
When code is cheap to produce, the scarce skill is understanding it.
2 min read - The industry
Writing code was never the whole job.
As implementation gets faster, the questions around it become harder to ignore.
2 min read - Building with AI
The hard part starts after the demo.
A convincing prototype and a dependable product ask different things of you.
2 min read - Staying relevant
You don’t need to learn everything.
Build a learning practice that survives the next framework, model, and headline.
2 min read