Writing code that machines will read

As AI moves into the editor, the way we write software is quietly changing shape.

Khoa VuJul 02, 20261 min read
Writing code that machines will read

For decades, code was written for humans first and computers second. That assumption is being tested. Increasingly, the second reader of your code is not another engineer but a model — one that will extend it, refactor it, and occasionally hallucinate its intent.

The best engineers are treating models as collaborators: writing with intent, leaving context, and reviewing generated work with the same rigor as their own. They name things carefully because a good name is now a prompt. They write comments that explain why, because a model can always infer what.

This changes the shape of a codebase in small ways. Files become more self-contained, so a model does not have to hold the whole repo in its head. Tests become more descriptive, so generated code has a specification to satisfy. Documentation moves closer to the code it describes, because that is where the model will look first.

The risk is not that AI writes bad code. It is that it writes plausible code — code that runs, passes tests, and quietly encodes an assumption no one questioned. The engineer's job is shifting from author to editor, and editing well is a harder skill than most of us admit.

The teams that will do well are not the ones who use these tools the most aggressively. They are the ones who stay curious about what the tool got wrong, and rigorous about what it got right.

Related reads