AI is great at coding and mediocre at writing for the same reason: most useful code is really about pattern reuse and most good writing is not.
At first, this might seem backwards. Both code and essays are just text, but code has to follow exact rules while an essay can be written countless ways. You might expect a language model to be better at the less constrained task. In practice, those constraints are actually part of what makes coding easier for AI.
I've been thinking about this quite a bit since this tweet, so I figured I'd put some thoughts on paper (keyboard?).
Coding and writing require very different things.
Why AI is so good at coding
The biggest difference is that most programming does not require a new idea. Building an auth flow, a settings page, or an API endpoint is usually applying patterns that thousands of developers have applied before. Sure, the details change, but much of the implementation is familiar. That is exactly the kind of work AI is good at: recognizing a pattern, adapting it to the situation, and producing a working solution.
Code also has a much tighter feedback loop, giving AI/agents an immediate way to validate their work. It either compiles or it doesn't. Tests pass or fail. Types line up or they don't. An AI can write some code, check the result, and correct itself. The space of possible solutions is large, but at least boundaries are visible.
It's not really "coding versus writing"
Good writing is different. A good essay has to do more than assemble ideas into polished sentences. It needs an idea of its own - or at least a familiar idea seen from a perspective that makes the reader reconsider it. The writer's job is both to find that point of view and communicate it to the reader: to make a connection others missed, develop an argument worth considering, or turn an experience into an insight.
There is no test suite for that. A paragraph can be grammatically perfect, logically coherent, and still completely uninteresting. This is why AI writing often feels so average. Average code can be useful in many tasks. It just needs to follow conventions, handle the common cases, and ultimately get a job done. But average writing is usually the writing we skip.
The distinction is not really coding versus writing, though. It is work that applies established patterns versus work that depends on a viewpoint or new idea.
AI can be very good at writing when the writing is mostly about applying patterns or logic: release notes, documentation, status updates, summaries, and routine emails. In those cases, originality may even be a liability. The goal is to communicate known information clearly, where introducing new ideas can actually be detrimental.
And AI can struggle with coding when the work is not about building blocks: choosing an architecture with uncommon constraints, coming up with a new algorithm, or making a judgment call where information is limited. Those tasks require taste, lots of context, or a genuinely new approach.
A better way to judge a task
Knowing this gives us a better way to decide what kinds of questions to ask AI. Instead of bucketing your task as "writing", "coding", "design", "research", etc., ask yourself what a good answer requires.
Does it require finding and applying a well-established pattern? Does it have unique constraints that are unlikely to be encountered elsewhere? Can the result be easily checked with a test, a trusted source, a calculation, or some other metric? If so, AI is likely to be useful.
On the other hand, if it requires taking a position, deciding what matters, or creating something whose value depends on taste, there is no clear feedback beyond "what feels right". Sure, AI may still help you think through a problem, but it should not be the one making the final call.
You can apply this filter almost anywhere. AI can summarize a legal document more reliably than it can invent a novel legal argument. It can build a page from an existing design system more reliably than it can create a brand from scratch (or at least one worth copying). It can compare logical options (well, not all the time) more reliably than it can decide the amount of risk your company should take.
On the other side, boundaries are rarely absolute. AI can occasionally produce an original connection, and people do plenty of formulaic writing. But this mental model is useful because it predicts where AI will be dependable and where it will need more supervision.
The right question is not necessarily "Can AI do this?". It is, "What kind of work does this task actually require?".>mg